From 3df6ff186f1c4bcb9e990b94fe4ea51f8e3a29da Mon Sep 17 00:00:00 2001 From: antonin gallon Date: Fri, 28 Nov 2025 17:58:50 +0100 Subject: [PATCH] tout doit disparaitre --- site/blueprints/pages/author.yml | 10 ++- site/plugins/your-plugin/index.css | 2 - site/plugins/your-plugin/index.js | 41 +------------ site/plugins/your-plugin/index.php | 30 ++++----- .../src/components/DemoSection.vue | 60 ------------------ .../src/components/Web2printField.vue | 61 +++++++++++++++++++ site/plugins/your-plugin/src/index.js | 6 +- 7 files changed, 86 insertions(+), 124 deletions(-) delete mode 100644 site/plugins/your-plugin/src/components/DemoSection.vue create mode 100644 site/plugins/your-plugin/src/components/Web2printField.vue diff --git a/site/blueprints/pages/author.yml b/site/blueprints/pages/author.yml index f17f9f2..598ce96 100644 --- a/site/blueprints/pages/author.yml +++ b/site/blueprints/pages/author.yml @@ -8,8 +8,14 @@ tabs: presentationSection: type: fields fields: - demo: - type: demo + + web2printTest: + type: web2print + options: + - summary + - page-number + - cover + presentation: extends: fields/body label: Présentation diff --git a/site/plugins/your-plugin/index.css b/site/plugins/your-plugin/index.css index d9c4995..e69de29 100644 --- a/site/plugins/your-plugin/index.css +++ b/site/plugins/your-plugin/index.css @@ -1,2 +0,0 @@ - -/** Put your CSS here **/ diff --git a/site/plugins/your-plugin/index.js b/site/plugins/your-plugin/index.js index 8b85eda..a149249 100644 --- a/site/plugins/your-plugin/index.js +++ b/site/plugins/your-plugin/index.js @@ -1,40 +1 @@ -(function() { - "use strict"; - function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) { - var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports; - if (render) { - options.render = render; - options.staticRenderFns = staticRenderFns; - options._compiled = true; - } - return { - exports: scriptExports, - options - }; - } - const _sfc_main = { - // Put your section logic here - }; - var _sfc_render = function render() { - var _vm = this; - _vm._self._c; - return _vm._m(0); - }; - var _sfc_staticRenderFns = [function() { - var _vm = this, _c = _vm._self._c; - return _c("section", { staticClass: "k-demo-section" }, [_c("header", { staticClass: "k-section-header" }, [_c("h2", { staticClass: "k-headline" }, [_vm._v("Test")])])]); - }]; - _sfc_render._withStripped = true; - var __component__ = /* @__PURE__ */ normalizeComponent( - _sfc_main, - _sfc_render, - _sfc_staticRenderFns - ); - __component__.options.__file = "C:/Users/anton/Desktop/studioVariable/actuelleInactuelle/actuel-inactuel/site/plugins/your-plugin/src/components/DemoSection.vue"; - const DemoSection = __component__.exports; - window.panel.plugin("getkirby/pluginkit", { - sections: { - demo: DemoSection - } - }); -})(); +(function(){"use strict";function d(n,t,o,c,s,r,i,a){var e=typeof n=="function"?n.options:n;return t&&(e.render=t,e.staticRenderFns=o,e._compiled=!0),{exports:n,options:e}}const l={__name:"Web2PrintBtn",props:{htmlPageString:String},setup(n){const{htmlPageString:t}=n;async function o(){const r=await fetch("https://web2print.studio-variable.com",{method:"POST","Content-Type":"application/pdf","X-API-Key":"25377ab6e2153b159d1d5fa22501228810b6aec9d63346bd0614045dc167061c",body:{html:t}});if(r.ok){const i=await r.blob(),a=window.URL.createObjectURL(i),e=document.createElement("a");e.href=a,e.download="document.pdf",e.click()}else{const i=await r.json();console.error("Erreur:",i)}}return{__sfc:!0,getPdf:o}}};var u=function(){var t=this,o=t._self._c,c=t._self._setupProxy;return o("k-button",{attrs:{variant:"filled"},on:{click:function(s){return c.getPdf()}}},[t._v("Button")])},f=[],_=d(l,u,f);const p=_.exports;window.panel.plugin("studio-variable/web2print",{fields:{web2print:p}})})(); diff --git a/site/plugins/your-plugin/index.php b/site/plugins/your-plugin/index.php index 1be738a..2b8a31b 100644 --- a/site/plugins/your-plugin/index.php +++ b/site/plugins/your-plugin/index.php @@ -1,20 +1,16 @@ [ - 'demo' => [ - 'props' => [ - 'value' => function ($value = null) { - $margins = Yaml::decode($value); - return [ - 'top' => 0, - 'right' => 0, - 'bottom' => 0, - 'left' => 0, - ...$margins - ]; - } - ] - ] - ], +Kirby::plugin('studio-variable/web2print', [ + 'fields' => [ + 'web2print' => [ + 'props' => [ + 'options' => function ($options = []) { + return $options; + }, + 'value' => function ($value = []) { + return $value; + } + ], + ], + ], ]); diff --git a/site/plugins/your-plugin/src/components/DemoSection.vue b/site/plugins/your-plugin/src/components/DemoSection.vue deleted file mode 100644 index 02accdc..0000000 --- a/site/plugins/your-plugin/src/components/DemoSection.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/site/plugins/your-plugin/src/components/Web2printField.vue b/site/plugins/your-plugin/src/components/Web2printField.vue new file mode 100644 index 0000000..3d0d1af --- /dev/null +++ b/site/plugins/your-plugin/src/components/Web2printField.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/site/plugins/your-plugin/src/index.js b/site/plugins/your-plugin/src/index.js index a0895ca..288e91c 100644 --- a/site/plugins/your-plugin/src/index.js +++ b/site/plugins/your-plugin/src/index.js @@ -1,7 +1,7 @@ -import DemoSection from "./components/DemoSection.vue"; +import ToggleGroup from "./components/Web2printField.vue"; -window.panel.plugin("getkirby/pluginkit", { +window.panel.plugin("studio-variable/web2print", { fields: { - demo: DemoSection + web2print: ToggleGroup } });