Update docs
This commit is contained in:
parent
ff668eff31
commit
54c71ff81c
|
@ -1,2 +1,2 @@
|
|||
import{d as a,m as s,p,c as r,a as e,f as t}from"./index.2f19b693.js";/* empty css */var l=a({name:"sb-paragraph-display",model:s,props:{data:{type:Object,default:p}},setup(a){const s=r((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>e("p",t({class:s.value},{innerHTML:a.data.value}),null)}});export default l;
|
||||
//# sourceMappingURL=display.9143f05a.js.map
|
||||
import{d as a,m as s,p,c as r,a as e,f as t}from"./index.db295836.js";/* empty css */var l=a({name:"sb-paragraph-display",model:s,props:{data:{type:Object,default:p}},setup(a){const s=r((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>e("p",t({class:s.value},{innerHTML:a.data.value}),null)}});export default l;
|
||||
//# sourceMappingURL=display.033a02b7.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"display.9143f05a.js","sources":["../../../paragraph/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType<IParagraphData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-paragraph': true,\n [`sb-paragraph_align-${props.data.align}`]: true,\n }));\n\n return () => <p\n class={classes.value}\n {...{\n innerHTML: props.data.value,\n }}\n ></p>;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","setup","classes","computed","align","value","innerHTML"],"mappings":"kGAeA,MAAeA,EAAgB,CAC7BC,KAAM,uBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,KAAO,iBACd,GACd,sBAAqBR,EAAMC,KAAKQ,UAAU,YAGvC,mBACEF,EAAQG,QAEbC,UAAWX,EAAMC,KAAKS"}
|
||||
{"version":3,"file":"display.033a02b7.js","sources":["../../../paragraph/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType<IParagraphData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-paragraph': true,\n [`sb-paragraph_align-${props.data.align}`]: true,\n }));\n\n return () => <p\n class={classes.value}\n {...{\n innerHTML: props.data.value,\n }}\n ></p>;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","setup","classes","computed","align","value","innerHTML"],"mappings":"kGAeA,MAAeA,EAAgB,CAC7BC,KAAM,uBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,KAAO,iBACd,GACd,sBAAqBR,EAAMC,KAAKQ,UAAU,YAGvC,mBACEF,EAAQG,QAEbC,UAAWX,EAAMC,KAAKS"}
|
|
@ -1,2 +1,2 @@
|
|||
var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,o=(t,a,n)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[a]=n,r=(e,r)=>{for(var l in r||(r={}))t.call(r,l)&&o(e,l,r[l]);if(a)for(var l of a(r))n.call(r,l)&&o(e,l,r[l]);return e};import{d as l,m as p,t as s,a as i,n as c}from"./index.2f19b693.js";var u=l({name:"sb-missing-block",model:p,props:r(r({},s),{name:String,data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>i("div",{class:"sb-missing-block"},[c("Missing block: "),e.name])});export default u;
|
||||
//# sourceMappingURL=display.3df7ba9d.js.map
|
||||
var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,o=(t,a,n)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[a]=n,r=(e,r)=>{for(var l in r||(r={}))t.call(r,l)&&o(e,l,r[l]);if(a)for(var l of a(r))n.call(r,l)&&o(e,l,r[l]);return e};import{d as l,m as p,t as s,a as i,n as c}from"./index.db295836.js";var u=l({name:"sb-missing-block",model:p,props:r(r({},s),{name:String,data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>i("div",{class:"sb-missing-block"},[c("Missing block: "),e.name])});export default u;
|
||||
//# sourceMappingURL=display.096d038d.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"display.3df7ba9d.js","sources":["../../../core/lib/components/MissingBlock/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n blockProps,\n} from '../../block-helpers';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-missing-block',\n\n model,\n\n props: {\n ...blockProps,\n name: String,\n data: {\n type: (null as unknown) as PropType<any>,\n default: null,\n },\n eventUpdate: { type: Function, default: () => {} },\n eventAppendBlock: { type: Function, default: () => {} },\n eventRemoveBlock: { type: Function, default: () => {} },\n },\n\n setup(props) {\n return () => (\n <div class=\"sb-missing-block\">Missing block: {props.name}</div>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","__assign","blockProps","String","data","type","default","eventUpdate","Function","eventAppendBlock","eventRemoveBlock","setup"],"mappings":"uZAQeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAOC,OACFC,GADE,CAELJ,KAAMK,OACNC,KAAM,CACJC,KAAO,KACPC,QAAS,MAEXC,YAAa,CAAEF,KAAMG,SAAUF,QAAS,QACxCG,iBAAkB,CAAEJ,KAAMG,SAAUF,QAAS,QAC7CI,iBAAkB,CAAEL,KAAMG,SAAUF,QAAS,UAG/CK,MAAMX,GACG,mBACM,0CAAmCA,EAAMF"}
|
||||
{"version":3,"file":"display.096d038d.js","sources":["../../../core/lib/components/MissingBlock/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n blockProps,\n} from '../../block-helpers';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-missing-block',\n\n model,\n\n props: {\n ...blockProps,\n name: String,\n data: {\n type: (null as unknown) as PropType<any>,\n default: null,\n },\n eventUpdate: { type: Function, default: () => {} },\n eventAppendBlock: { type: Function, default: () => {} },\n eventRemoveBlock: { type: Function, default: () => {} },\n },\n\n setup(props) {\n return () => (\n <div class=\"sb-missing-block\">Missing block: {props.name}</div>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","__assign","blockProps","String","data","type","default","eventUpdate","Function","eventAppendBlock","eventRemoveBlock","setup"],"mappings":"uZAQeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAOC,OACFC,GADE,CAELJ,KAAMK,OACNC,KAAM,CACJC,KAAO,KACPC,QAAS,MAEXC,YAAa,CAAEF,KAAMG,SAAUF,QAAS,QACxCG,iBAAkB,CAAEJ,KAAMG,SAAUF,QAAS,QAC7CI,iBAAkB,CAAEL,KAAMG,SAAUF,QAAS,UAG/CK,MAAMX,GACG,mBACM,0CAAmCA,EAAMF"}
|
|
@ -1,2 +0,0 @@
|
|||
import{d as a,m as s,g as t,c as l,a as e,e as o}from"./index.2f19b693.js";/* empty css */var d=a({name:"sb-layout-display",model:s,props:{data:{type:null,default:t}},setup(a){const s=l((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>e("div",{class:s.value},[...a.data.children.map((a=>e(o,{key:a.id,block:a},null)))])}});export default d;
|
||||
//# sourceMappingURL=display.53aa9250.js.map
|
2
packages/docs/docs/assets/display.d31e0ebf.js
Normal file
2
packages/docs/docs/assets/display.d31e0ebf.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import{d as a,m as s,g as t,c as l,a as e,e as d}from"./index.db295836.js";/* empty css */var o=a({name:"sb-layout-display",model:s,props:{data:{type:null,default:t}},setup(a){const s=l((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>e("div",{class:s.value},[...a.data.children.map((a=>e(d,{key:a.id,block:a},null)))])}});export default o;
|
||||
//# sourceMappingURL=display.d31e0ebf.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"display.53aa9250.js","sources":["../../../layout/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n ILayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType<ILayoutData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${props.data.orientation}`]: true,\n }));\n\n return () => (\n <div class={classes.value}>\n {...props.data.children.map((child) => (\n <SbBlock\n key={child.id}\n block={child}\n />\n ))}\n </div>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","classes","computed","orientation","value","children","map","child","id"],"mappings":"uGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,SACEM,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYP,EAAMC,KAAKO,gBAAgB,YAGpC,mBACOF,EAAQG,WACdT,EAAMC,KAAKS,SAASC,iBAEfC,EAAMC,SACJD"}
|
||||
{"version":3,"file":"display.d31e0ebf.js","sources":["../../../layout/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n ILayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType<ILayoutData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${props.data.orientation}`]: true,\n }));\n\n return () => (\n <div class={classes.value}>\n {...props.data.children.map((child) => (\n <SbBlock\n key={child.id}\n block={child}\n />\n ))}\n </div>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","classes","computed","orientation","value","children","map","child","id"],"mappings":"uGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,SACEM,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYP,EAAMC,KAAKO,gBAAgB,YAGpC,mBACOF,EAAQG,WACdT,EAAMC,KAAKS,SAASC,iBAEfC,EAAMC,SACJD"}
|
2
packages/docs/docs/assets/display.e4e30792.js
Normal file
2
packages/docs/docs/assets/display.e4e30792.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import{d as a,m as e,j as s,c as d,q as t}from"./index.db295836.js";/* empty css */var l=a({name:"sb-heading-display",model:e,props:{data:{type:Object,default:s}},setup(a){const e=d((()=>({"sb-heading":!0,[`sb-heading_align-${a.data.align}`]:!0,[`sb-heading_${a.data.level}`]:!0})));return()=>t(`h${a.data.level}`,{class:e.value,innerHTML:a.data.value})}});export default l;
|
||||
//# sourceMappingURL=display.e4e30792.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"display.f1bc6040.js","sources":["../../../heading/lib/display.ts"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n h,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IHeadingData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-heading-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType<IHeadingData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-heading': true,\n [`sb-heading_align-${props.data.align}`]: true,\n [`sb-heading_${props.data.level}`]: true,\n }));\n\n return () => h(\n `h${props.data.level}`,\n {\n class: classes.value,\n innerHTML: props.data.value,\n },\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","[object Object]","classes","computed","sb-heading","align","level","h","class","value","innerHTML"],"mappings":"gGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,qBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,MACvBC,cAAc,GACb,oBAAoBT,EAAMC,KAAKS,UAAU,GACzC,cAAcV,EAAMC,KAAKU,UAAU,YAG/B,IAAMC,EACX,IAAIZ,EAAMC,KAAKU,QACf,CACEE,MAAON,EAAQO,MACfC,UAAWf,EAAMC,KAAKa"}
|
||||
{"version":3,"file":"display.e4e30792.js","sources":["../../../heading/lib/display.ts"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n h,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IHeadingData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-heading-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType<IHeadingData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-heading': true,\n [`sb-heading_align-${props.data.align}`]: true,\n [`sb-heading_${props.data.level}`]: true,\n }));\n\n return () => h(\n `h${props.data.level}`,\n {\n class: classes.value,\n innerHTML: props.data.value,\n },\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","[object Object]","classes","computed","sb-heading","align","level","h","class","value","innerHTML"],"mappings":"gGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,qBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,MACvBC,cAAc,GACb,oBAAoBT,EAAMC,KAAKS,UAAU,GACzC,cAAcV,EAAMC,KAAKU,UAAU,YAG/B,IAAMC,EACX,IAAIZ,EAAMC,KAAKU,QACf,CACEE,MAAON,EAAQO,MACfC,UAAWf,EAAMC,KAAKa"}
|
|
@ -1,2 +1,2 @@
|
|||
import{d as a,m as s,s as e,a as t,e as l}from"./index.2f19b693.js";/* empty css */var d=a({name:"sb-image-display",model:s,props:{data:{type:null,default:e}},setup:a=>()=>t("figure",{class:"sb-image"},[t("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),t(l,{block:a.data.description},null)])});export default d;
|
||||
//# sourceMappingURL=display.b625d393.js.map
|
||||
import{d as a,m as s,s as e,a as t,e as l}from"./index.db295836.js";/* empty css */var d=a({name:"sb-image-display",model:s,props:{data:{type:null,default:e}},setup:a=>()=>t("figure",{class:"sb-image"},[t("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),t(l,{block:a.data.description},null)])});export default d;
|
||||
//# sourceMappingURL=display.ee46637f.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"display.b625d393.js","sources":["../../../image/lib/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType<IImageData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n return () => <figure class=\"sb-image\">\n <img\n class=\"sb-image__content\"\n src={props.data.src}\n alt={props.data.alt}\n />\n <SbBlock block={props.data.description} />\n </figure>;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","src","alt","description"],"mappings":"gGAYA,MAAeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,GACG,sBAAoB,4BAEf,wBACDA,EAAMC,KAAKK,QACXN,EAAMC,KAAKM,sBAEFP,EAAMC,KAAKO"}
|
||||
{"version":3,"file":"display.ee46637f.js","sources":["../../../image/lib/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType<IImageData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n return () => <figure class=\"sb-image\">\n <img\n class=\"sb-image__content\"\n src={props.data.src}\n alt={props.data.alt}\n />\n <SbBlock block={props.data.description} />\n </figure>;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","src","alt","description"],"mappings":"gGAYA,MAAeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,GACG,sBAAoB,4BAEf,wBACDA,EAAMC,KAAKK,QACXN,EAAMC,KAAKM,sBAEFP,EAAMC,KAAKO"}
|
|
@ -1,2 +0,0 @@
|
|||
import{d as a,m as e,j as s,c as t,q as d}from"./index.2f19b693.js";/* empty css */var l=a({name:"sb-heading-display",model:e,props:{data:{type:Object,default:s}},setup(a){const e=t((()=>({"sb-heading":!0,[`sb-heading_align-${a.data.align}`]:!0,[`sb-heading_${a.data.level}`]:!0})));return()=>d(`h${a.data.level}`,{class:e.value,innerHTML:a.data.value})}});export default l;
|
||||
//# sourceMappingURL=display.f1bc6040.js.map
|
2
packages/docs/docs/assets/edit.0b03ba30.js
Normal file
2
packages/docs/docs/assets/edit.0b03ba30.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
var a=Object.defineProperty,e=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(e,t,l)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,s=(a,s)=>{for(var n in s||(s={}))e.call(s,n)&&r(a,n,s[n]);if(t)for(var n of t(s))l.call(s,n)&&r(a,n,s[n]);return a};import{d as n,m as o,s as i,r as d,k as c,w as u,a as p,S as f,b as v,n as m,F as b,e as y}from"./index.db295836.js";/* empty css */var g=n({name:"sb-image-edit",model:o,props:{onUpdate:{type:null,default:()=>{}},data:{type:null,default:i}},setup(a){const e=d({src:a.data.src,alt:a.data.alt,description:a.data.description}),t=c(null);u((()=>a.data),(()=>{e.src=a.data.src,e.alt=a.data.alt,e.description=a.data.description}));const l=()=>{t.value&&t.value.click()},r=()=>{if(t.value&&t.value.files&&t.value.files.length){const e=new FileReader;e.addEventListener("load",(()=>{var t;const l=null==(t=null==e?void 0:e.result)?void 0:t.toString();if(!l)throw new Error("Couldn't load image src");a.onUpdate({src:l,alt:a.data.alt,description:a.data.description})})),e.readAsDataURL(t.value.files[0])}};return()=>p("figure",{class:"sb-image"},[p(f,null,{default:()=>[e.src?p(v,{onClick:l},{default:()=>[m("Select Image")]}):null,p("input",{type:"file",ref:t,style:"display: none;",onInput:r},null)]}),e.src?p(b,null,[p("img",{src:e.src,alt:e.alt,class:"sb-image__content"},null),p(y,{block:e.description,onUpdate:e=>{return t=e,void a.onUpdate(s(s({},a.data),{description:t}));var t}},null)]):p(v,{onClick:l},{default:()=>[m("Select Image")]})])}});export default g;
|
||||
//# sourceMappingURL=edit.0b03ba30.js.map
|
1
packages/docs/docs/assets/edit.0b03ba30.js.map
Normal file
1
packages/docs/docs/assets/edit.0b03ba30.js.map
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"edit.0b03ba30.js","sources":["../../../image/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n ref,\n Ref,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n SbToolbar,\n SbButton,\n SbBlock,\n IBlockData,\n OnUpdateSelfCb,\n} from '@schlechtenburg/core';\nimport { IParagraphData } from '@schlechtenburg/paragraph';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-edit',\n\n model,\n\n props: {\n onUpdate: {\n type: (null as unknown) as PropType<OnUpdateSelfCb<IImageData>>,\n default: () => {},\n },\n data: {\n type: (null as unknown) as PropType<IImageData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const localData = reactive({\n src: props.data.src,\n alt: props.data.alt,\n description: props.data.description,\n });\n\n const fileInput: Ref<null|HTMLInputElement> = ref(null);\n\n watch(() => props.data, () => {\n localData.src = props.data.src;\n localData.alt = props.data.alt;\n localData.description = props.data.description;\n });\n\n const selectImage = () => {\n if (fileInput.value) {\n fileInput.value.click();\n }\n };\n\n const onImageSelect = () => {\n if (fileInput.value && fileInput.value.files && fileInput.value.files.length) {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n const src = reader?.result?.toString();\n if (!src) {\n throw new Error('Couldn\\'t load image src');\n }\n\n props.onUpdate({\n src,\n alt: props.data.alt,\n description: props.data.description,\n });\n });\n\n reader.readAsDataURL(fileInput.value.files[0]);\n }\n };\n\n const onDescriptionUpdate = (description: IBlockData<IParagraphData>) => {\n props.onUpdate({\n ...props.data,\n description,\n });\n };\n\n return () => (\n <figure class=\"sb-image\">\n <SbToolbar>\n {localData.src\n ? <SbButton {...{ onClick: selectImage }}>Select Image</SbButton>\n : null}\n <input\n type=\"file\"\n ref={fileInput}\n style=\"display: none;\"\n onInput={onImageSelect}\n />\n </SbToolbar>\n {localData.src\n ? <>\n <img\n src={localData.src}\n alt={localData.alt}\n class=\"sb-image__content\"\n />\n <SbBlock\n block={localData.description}\n onUpdate={(updated: IBlockData<IParagraphData>) => onDescriptionUpdate(updated)}\n />\n </>\n : <SbButton {...{ onClick: selectImage }}>Select Image</SbButton>\n }\n </figure>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","default","data","getDefaultData","setup","localData","reactive","src","alt","description","fileInput","ref","selectImage","value","click","onImageSelect","files","length","reader","FileReader","addEventListener","result","toString","Error","readAsDataURL","onClick","onDescriptionUpdate","updated","__assign"],"mappings":"8dAwBA,MAAeA,EAAgB,CAC7BC,KAAM,gBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CACRC,KAAO,KACPC,QAAS,QAEXC,KAAM,CACJF,KAAO,KACPC,QAASE,IAIbC,MAAMN,SACEO,EAAYC,EAAS,CACzBC,IAAKT,EAAMI,KAAKK,IAChBC,IAAKV,EAAMI,KAAKM,IAChBC,YAAaX,EAAMI,KAAKO,cAGpBC,EAAwCC,EAAI,SAE5C,IAAMb,EAAMI,OAAM,OACZK,IAAMT,EAAMI,KAAKK,MACjBC,IAAMV,EAAMI,KAAKM,MACjBC,YAAcX,EAAMI,KAAKO,qBAG/BG,EAAc,KACdF,EAAUG,SACFA,MAAMC,SAIdC,EAAgB,QAChBL,EAAUG,OAASH,EAAUG,MAAMG,OAASN,EAAUG,MAAMG,MAAMC,OAAQ,OACtEC,EAAS,IAAIC,aACZC,iBAAiB,QAAQ,iBACxBb,EAAMW,0BAAQG,iBAAQC,eACvBf,QACG,IAAIgB,MAAM,6BAGZxB,SAAS,CACbQ,IAAAA,EACAC,IAAKV,EAAMI,KAAKM,IAChBC,YAAaX,EAAMI,KAAKO,mBAIrBe,cAAcd,EAAUG,MAAMG,MAAM,YAWxC,sBACS,oCAETX,EAAUE,SACSkB,QAASb,sCACzB,qBAEG,WACAF,QACC,yBACGK,YAGZV,EAAUE,2BAGEF,EAAUE,QACVF,EAAUG,UACT,sCAGCH,EAAUI,yBACkCiB,SAAoBC,SA5B3E5B,SAAS6B,OACV9B,EAAMI,MADI,CAEbO,YAAAA,KAHyBA,qBAgCLgB,QAASb"}
|
|
@ -1,2 +0,0 @@
|
|||
var e=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,r=(n,i,t)=>i in n?e(n,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[i]=t,l=(e,l)=>{for(var a in l||(l={}))n.call(l,a)&&r(e,a,l[a]);if(i)for(var a of i(l))t.call(l,a)&&r(e,a,l[a]);return e};import{d as a,m as o,g as c,u as d,r as h,w as s,c as p,a as u,S as f,b,e as v,f as m,h as y,i as U}from"./index.2f19b693.js";/* empty css */var k=a({name:"sb-layout-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:c}},setup(e){const{activate:n}=d(),i=h({orientation:e.data.orientation,children:[...e.data.children]});s((()=>e.data),(()=>{i.orientation=e.data.orientation,i.children=[...e.data.children]}));const t=p((()=>({"sb-layout":!0,[`sb-layout_${i.orientation}`]:!0}))),r=()=>{e.onUpdate({orientation:"vertical"===i.orientation?"horizontal":"vertical"})},a=t=>{console.log(a),i.children=[...i.children,t],e.onUpdate({children:[...i.children]}),n(t.id)},o=(t,r)=>{i.children=[...i.children.slice(0,t+1),r,...i.children.slice(t+1)],e.onUpdate({children:[...i.children]}),n(r.id)},c=t=>{i.children=[...i.children.slice(0,t),...i.children.slice(t+1)],e.onUpdate({children:[...i.children]});const r=Math.max(t-1,0);n(i.children[r].id)},k=e=>{const t=Math.max(Math.min(i.children.length-1,e),0);n(i.children[t].id)};return()=>u("div",{class:t.value},[u(f,null,{default:()=>[u(b,{type:"button",onClick:r},{default:()=>[i.orientation]})]}),...i.children.map(((n,t)=>u(v,m({key:n.id},{"data-order":t,block:n,onUpdate:t=>((n,t)=>{const r=i.children.indexOf(n);-1!==r&&e.onUpdate({children:[...i.children.slice(0,r),l(l({},n),t),...i.children.slice(r+1)]})})(n,t),onRemoveSelf:()=>c(t),onPrependBlock:e=>o(t-1,e),onAppendBlock:e=>o(t,e),onActivatePrevious:()=>k(t-1),onActivateNext:()=>k(t+1)}),{"context-toolbar":()=>u(y,{onMoveBackward:()=>(n=>{if(0===n)return;const t=i.children[n],r=i.children[n-1];i.children=[...i.children.slice(0,n-1),t,r,...i.children.slice(n+1)],e.onUpdate({children:[...i.children]})})(t),onMoveForward:()=>(n=>{if(n===i.children.length-1)return;const t=i.children[n],r=i.children[n+1];i.children=[...i.children.slice(0,n),r,t,...i.children.slice(n+2)],e.onUpdate({children:[...i.children]})})(t),onRemove:()=>c(t),orientation:i.orientation},null)}))),u(U,{onInsertBlock:a},null)])}});export default k;
|
||||
//# sourceMappingURL=edit.0e6928af.js.map
|
File diff suppressed because one or more lines are too long
2
packages/docs/docs/assets/edit.121042a6.js
Normal file
2
packages/docs/docs/assets/edit.121042a6.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,t=(a,l,n)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[l]=n,o=(e,o)=>{for(var u in o||(o={}))a.call(o,u)&&t(e,u,o[u]);if(l)for(var u of l(o))n.call(o,u)&&t(e,u,o[u]);return e};import{d as u,m as i,j as v,r,k as d,u as s,o as p,w as c,c as f,a as g,S as y,l as b,n as h,p as m}from"./index.db295836.js";/* empty css */var w=u({name:"sb-heading-edit",model:i,props:{blockId:{type:String,required:!0},data:{type:null,default:v},onUpdate:{type:null,default:()=>{}},onAppendBlock:{type:null,default:()=>{}},onRemoveSelf:{type:null,default:()=>{}},onActivateNext:{type:null,default:()=>{}},onActivatePrevious:{type:null,default:()=>{}}},setup(e){const a=r({value:e.data.value,align:e.data.align,level:e.data.level,focused:!1}),l=d(null),{isActive:n,activate:t}=s(e.blockId),u=()=>{l.value&&n.value&&l.value.focus()};p((()=>{u(),l.value&&(l.value.innerHTML=a.value)})),c(n,u),c((()=>e.data),(()=>{a.value=e.data.value,a.align=e.data.align,a.level=e.data.level,l.value&&(l.value.innerHTML=a.value)}));const i=e=>{a.value=e.target.innerHTML},v=f((()=>({"sb-heading":!0,"sb-heading_focused":a.focused,[`sb-heading_align-${a.align}`]:!0,[`sb-heading_${a.level}`]:!0}))),w=l=>{e.onUpdate(o(o({},a),{level:parseInt(l.target.value,10)}))},k=l=>{e.onUpdate(o(o({},a),{align:l.target.value}))},A=()=>{a.focused=!0,t()},j=()=>{a.focused=!1,e.onUpdate({value:a.value,align:a.align,level:a.level})},O=a=>{if("Enter"===a.key&&!a.shiftKey){const l=""+ +new Date;e.onAppendBlock({id:l,name:"sb-paragraph",data:m()}),t(l),a.preventDefault()}},S=n=>{var t;"Backspace"===n.key&&""===a.value&&e.onRemoveSelf();const o=window.getSelection(),u=null==o?void 0:o.focusNode,i=Array.from((null==(t=null==l?void 0:l.value)?void 0:t.childNodes)||[]),v=u?i.indexOf(u):-1;if(u===l.value||0===v||v===i.length-1)switch(n.key){case"ArrowDown":e.onActivateNext();break;case"ArrowUp":e.onActivatePrevious()}};return()=>g("div",{class:v.value},[g(y,null,{default:()=>[g(b,{value:a.level,onChange:w},{default:()=>[g("option",{value:1},[h("h1")]),g("option",{value:2},[h("h2")]),g("option",{value:3},[h("h3")]),g("option",{value:4},[h("h4")]),g("option",{value:5},[h("h5")]),g("option",{value:6},[h("h6")])]}),g(b,{value:a.align,onChange:k},{default:()=>[g("option",null,[h("left")]),g("option",null,[h("center")]),g("option",null,[h("right")])]})]}),g("p",{class:"sb-heading__input",ref:l,contenteditable:!0,onInput:i,onFocus:A,onBlur:j,onKeydown:O,onKeyup:S},null)])}});export default w;
|
||||
//# sourceMappingURL=edit.121042a6.js.map
|
1
packages/docs/docs/assets/edit.121042a6.js.map
Normal file
1
packages/docs/docs/assets/edit.121042a6.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,t=(a,l,n)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[l]=n,o=(e,o)=>{for(var u in o||(o={}))a.call(o,u)&&t(e,u,o[u]);if(l)for(var u of l(o))n.call(o,u)&&t(e,u,o[u]);return e};import{d as u,m as i,j as v,r,k as d,u as s,o as p,w as c,c as f,a as g,S as y,l as b,n as h,p as m}from"./index.2f19b693.js";/* empty css */var w=u({name:"sb-heading-edit",model:i,props:{blockId:{type:String,required:!0},data:{type:null,default:v},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(e){const a=r({value:e.data.value,align:e.data.align,level:e.data.level,focused:!1}),l=d(null),{isActive:n,activate:t}=s(e.blockId),u=()=>{l.value&&n.value&&l.value.focus()};p((()=>{u(),l.value&&(l.value.innerHTML=a.value)})),c(n,u),c((()=>e.data),(()=>{a.value=e.data.value,a.align=e.data.align,a.level=e.data.level,l.value&&(l.value.innerHTML=a.value)}));const i=e=>{a.value=e.target.innerHTML},v=f((()=>({"sb-heading":!0,"sb-heading_focused":a.focused,[`sb-heading_align-${a.align}`]:!0,[`sb-heading_${a.level}`]:!0}))),w=l=>{e.onUpdate(o(o({},a),{level:parseInt(l.target.value,10)}))},k=l=>{e.onUpdate(o(o({},a),{align:l.target.value}))},A=()=>{a.focused=!0,t()},j=()=>{a.focused=!1,e.onUpdate({value:a.value,align:a.align,level:a.level})},O=a=>{if("Enter"===a.key&&!a.shiftKey){const l=""+ +new Date;e.onAppendBlock({id:l,name:"sb-paragraph",data:m()}),t(l),a.preventDefault()}},F=n=>{var t;"Backspace"===n.key&&""===a.value&&e.onRemoveSelf();const o=window.getSelection(),u=null==o?void 0:o.focusNode,i=Array.from((null==(t=null==l?void 0:l.value)?void 0:t.childNodes)||[]),v=u?i.indexOf(u):-1;if(u===l.value||0===v||v===i.length-1)switch(n.key){case"ArrowDown":e.onActivateNext();break;case"ArrowUp":e.onActivatePrevious()}};return()=>g("div",{class:v.value},[g(y,null,{default:()=>[g(b,{value:a.level,onChange:w},{default:()=>[g("option",{value:1},[h("h1")]),g("option",{value:2},[h("h2")]),g("option",{value:3},[h("h3")]),g("option",{value:4},[h("h4")]),g("option",{value:5},[h("h5")]),g("option",{value:6},[h("h6")])]}),g(b,{value:a.align,onChange:k},{default:()=>[g("option",null,[h("left")]),g("option",null,[h("center")]),g("option",null,[h("right")])]})]}),g("p",{class:"sb-heading__input",ref:l,contenteditable:!0,onInput:i,onFocus:A,onBlur:j,onKeydown:O,onKeyup:F},null)])}});export default w;
|
||||
//# sourceMappingURL=edit.146d9acf.js.map
|
File diff suppressed because one or more lines are too long
2
packages/docs/docs/assets/edit.7f829266.js
Normal file
2
packages/docs/docs/assets/edit.7f829266.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import{d as a,m as e,p as l,r as n,k as t,u,o,w as s,c as i,a as d,S as r,l as p,n as v}from"./index.db295836.js";/* empty css */var c=a({name:"sb-paragraph-edit",model:e,props:{blockId:{type:String,required:!0},data:{type:null,default:l},onUpdate:{type:null,default:()=>{}},onAppendBlock:{type:null,default:()=>{}},onRemoveSelf:{type:null,default:()=>{}},onActivateNext:{type:null,default:()=>{}},onActivatePrevious:{type:null,default:()=>{}}},setup(a){const e=n({value:a.data.value,align:a.data.align,focused:!1}),c=t(null),{isActive:f,activate:g}=u(a.blockId),y=()=>{c.value&&f.value&&c.value.focus()};o((()=>{y(),c.value&&(c.value.innerHTML=e.value)})),s(f,y),s((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,c.value&&(c.value.innerHTML=e.value)}));const b=a=>{e.value=a.target.innerHTML},h=i((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),k=l=>{a.onUpdate({value:e.value,align:l.target.value})},m=()=>{e.focused=!0,g()},A=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const n=""+ +new Date;a.onAppendBlock({id:n,name:"sb-paragraph",data:l()}),g(n),e.preventDefault()}},x=l=>{var n;"Backspace"===l.key&&""===e.value&&a.onRemoveSelf();const t=window.getSelection(),u=null==t?void 0:t.focusNode,o=Array.from((null==(n=null==c?void 0:c.value)?void 0:n.childNodes)||[]),s=u?o.indexOf(u):-1;if(u===c.value||0===s||s===o.length-1)switch(l.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>d("div",{class:h.value},[d(r,null,{default:()=>[d(p,{value:e.align,onChange:k},{default:()=>[d("option",null,[v("left")]),d("option",null,[v("center")]),d("option",null,[v("right")])]})]}),d("p",{class:"sb-paragraph__input",ref:c,contenteditable:!0,onInput:b,onFocus:m,onBlur:A,onKeydown:w,onKeyup:x},null)])}});export default c;
|
||||
//# sourceMappingURL=edit.7f829266.js.map
|
1
packages/docs/docs/assets/edit.7f829266.js.map
Normal file
1
packages/docs/docs/assets/edit.7f829266.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
var a=Object.defineProperty,e=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(e,t,l)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,n=(a,n)=>{for(var s in n||(n={}))e.call(n,s)&&r(a,s,n[s]);if(t)for(var s of t(n))l.call(n,s)&&r(a,s,n[s]);return a};import{d as s,m as o,s as i,r as d,k as c,w as u,a as p,S as f,b as v,n as m,F as b,e as y}from"./index.2f19b693.js";/* empty css */var g=s({name:"sb-image-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:i}},setup(a){const e=d({src:a.data.src,alt:a.data.alt,description:a.data.description}),t=c(null);u((()=>a.data),(()=>{e.src=a.data.src,e.alt=a.data.alt,e.description=a.data.description}));const l=()=>{t.value&&t.value.click()},r=()=>{if(t.value&&t.value.files&&t.value.files.length){const e=new FileReader;e.addEventListener("load",(()=>{var t;const l=null==(t=null==e?void 0:e.result)?void 0:t.toString();if(!l)throw new Error("Couldn't load image src");a.onUpdate({src:l,alt:a.data.alt,description:a.data.description})})),e.readAsDataURL(t.value.files[0])}};return()=>p("figure",{class:"sb-image"},[p(f,null,{default:()=>[e.src?p(v,{onClick:l},{default:()=>[m("Select Image")]}):null,p("input",{type:"file",ref:t,style:"display: none;",onInput:r},null)]}),e.src?p(b,null,[p("img",{src:e.src,alt:e.alt,class:"sb-image__content"},null),p(y,{block:e.description,onUpdate:e=>{return t=e,void a.onUpdate(n(n({},a.data),{description:t}));var t}},null)]):p(v,{onClick:l},{default:()=>[m("Select Image")]})])}});export default g;
|
||||
//# sourceMappingURL=edit.849203b1.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"edit.849203b1.js","sources":["../../../image/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n ref,\n Ref,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n SbToolbar,\n SbButton,\n SbBlock,\n IBlockData,\n} from '@schlechtenburg/core';\nimport { IParagraphData } from '@schlechtenburg/paragraph';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-edit',\n\n model,\n\n props: {\n onUpdate: { type: Function, default: () => {} },\n data: {\n type: (null as unknown) as PropType<IImageData>,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const localData = reactive({\n src: props.data.src,\n alt: props.data.alt,\n description: props.data.description,\n });\n\n const fileInput: Ref<null|HTMLInputElement> = ref(null);\n\n watch(() => props.data, () => {\n localData.src = props.data.src;\n localData.alt = props.data.alt;\n localData.description = props.data.description;\n });\n\n const selectImage = () => {\n if (fileInput.value) {\n fileInput.value.click();\n }\n };\n\n const onImageSelect = () => {\n if (fileInput.value && fileInput.value.files && fileInput.value.files.length) {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n const src = reader?.result?.toString();\n if (!src) {\n throw new Error('Couldn\\'t load image src');\n }\n\n props.onUpdate({\n src,\n alt: props.data.alt,\n description: props.data.description,\n });\n });\n\n reader.readAsDataURL(fileInput.value.files[0]);\n }\n };\n\n const onDescriptionUpdate = (description: IBlockData<IParagraphData>) => {\n props.onUpdate({\n ...props.data,\n description,\n });\n };\n\n return () => (\n <figure class=\"sb-image\">\n <SbToolbar>\n {localData.src\n ? <SbButton {...{ onClick: selectImage }}>Select Image</SbButton>\n : null}\n <input\n type=\"file\"\n ref={fileInput}\n style=\"display: none;\"\n onInput={onImageSelect}\n />\n </SbToolbar>\n {localData.src\n ? <>\n <img\n src={localData.src}\n alt={localData.alt}\n class=\"sb-image__content\"\n />\n <SbBlock\n block={localData.description}\n onUpdate={(updated: IBlockData<IParagraphData>) => onDescriptionUpdate(updated)}\n />\n </>\n : <SbButton {...{ onClick: selectImage }}>Select Image</SbButton>\n }\n </figure>\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","Function","default","data","getDefaultData","setup","localData","reactive","src","alt","description","fileInput","ref","selectImage","value","click","onImageSelect","files","length","reader","FileReader","addEventListener","result","toString","Error","readAsDataURL","onClick","onDescriptionUpdate","updated","__assign"],"mappings":"8dAuBA,MAAeA,EAAgB,CAC7BC,KAAM,gBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CAAEC,KAAMC,SAAUC,QAAS,QACrCC,KAAM,CACJH,KAAO,KACPE,QAASE,IAIbC,MAAMP,SACEQ,EAAYC,EAAS,CACzBC,IAAKV,EAAMK,KAAKK,IAChBC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,cAGpBC,EAAwCC,EAAI,SAE5C,IAAMd,EAAMK,OAAM,OACZK,IAAMV,EAAMK,KAAKK,MACjBC,IAAMX,EAAMK,KAAKM,MACjBC,YAAcZ,EAAMK,KAAKO,qBAG/BG,EAAc,KACdF,EAAUG,SACFA,MAAMC,SAIdC,EAAgB,QAChBL,EAAUG,OAASH,EAAUG,MAAMG,OAASN,EAAUG,MAAMG,MAAMC,OAAQ,OACtEC,EAAS,IAAIC,aACZC,iBAAiB,QAAQ,iBACxBb,EAAMW,0BAAQG,iBAAQC,eACvBf,QACG,IAAIgB,MAAM,6BAGZzB,SAAS,CACbS,IAAAA,EACAC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,mBAIrBe,cAAcd,EAAUG,MAAMG,MAAM,YAWxC,sBACS,oCAETX,EAAUE,SACSkB,QAASb,sCACzB,qBAEG,WACAF,QACC,yBACGK,YAGZV,EAAUE,2BAGEF,EAAUE,QACVF,EAAUG,UACT,sCAGCH,EAAUI,yBACkCiB,SAAoBC,SA5B3E7B,SAAS8B,OACV/B,EAAMK,MADI,CAEbO,YAAAA,KAHyBA,qBAgCLgB,QAASb"}
|
2
packages/docs/docs/assets/edit.a2b46012.js
Normal file
2
packages/docs/docs/assets/edit.a2b46012.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
var e=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,l=(n,i,t)=>i in n?e(n,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[i]=t,r=(e,r)=>{for(var a in r||(r={}))n.call(r,a)&&l(e,a,r[a]);if(i)for(var a of i(r))t.call(r,a)&&l(e,a,r[a]);return e};import{d as a,m as o,g as c,u as d,r as h,w as s,c as p,a as u,S as f,b,e as v,f as m,h as y,i as U}from"./index.db295836.js";/* empty css */var k=a({name:"sb-layout-edit",model:o,props:{onUpdate:{type:null,default:()=>{}},data:{type:null,default:c}},setup(e){const{activate:n}=d(),i=h({orientation:e.data.orientation,children:[...e.data.children]});s((()=>e.data),(()=>{i.orientation=e.data.orientation,i.children=[...e.data.children]}));const t=p((()=>({"sb-layout":!0,[`sb-layout_${i.orientation}`]:!0}))),l=()=>{e.onUpdate({orientation:"vertical"===i.orientation?"horizontal":"vertical"})},a=t=>{console.log(a),i.children=[...i.children,t],e.onUpdate({children:[...i.children]}),n(t.id)},o=(t,l)=>{i.children=[...i.children.slice(0,t+1),l,...i.children.slice(t+1)],e.onUpdate({children:[...i.children]}),n(l.id)},c=t=>{i.children=[...i.children.slice(0,t),...i.children.slice(t+1)],e.onUpdate({children:[...i.children]});const l=Math.max(t-1,0);n(i.children[l].id)},k=e=>{const t=Math.max(Math.min(i.children.length-1,e),0);n(i.children[t].id)};return()=>u("div",{class:t.value},[u(f,null,{default:()=>[u(b,{type:"button",onClick:l},{default:()=>[i.orientation]})]}),...i.children.map(((n,t)=>u(v,m({key:n.id},{"data-order":t,block:n,onUpdate:t=>((n,t)=>{const l=i.children.indexOf(n);-1!==l&&e.onUpdate({children:[...i.children.slice(0,l),r(r({},n),t),...i.children.slice(l+1)]})})(n,t),onRemoveSelf:()=>c(t),onPrependBlock:e=>o(t-1,e),onAppendBlock:e=>o(t,e),onActivatePrevious:()=>k(t-1),onActivateNext:()=>k(t+1)}),{"context-toolbar":()=>u(y,{onMoveBackward:()=>(n=>{if(0===n)return;const t=i.children[n],l=i.children[n-1];i.children=[...i.children.slice(0,n-1),t,l,...i.children.slice(n+1)],e.onUpdate({children:[...i.children]})})(t),onMoveForward:()=>(n=>{if(n===i.children.length-1)return;const t=i.children[n],l=i.children[n+1];i.children=[...i.children.slice(0,n),l,t,...i.children.slice(n+2)],e.onUpdate({children:[...i.children]})})(t),onRemove:()=>c(t),orientation:i.orientation},null)}))),u(U,{onInsertBlock:a},null)])}});export default k;
|
||||
//# sourceMappingURL=edit.a2b46012.js.map
|
1
packages/docs/docs/assets/edit.a2b46012.js.map
Normal file
1
packages/docs/docs/assets/edit.a2b46012.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
import{d as a,m as e,p as n,r as l,k as t,u as o,o as u,w as i,c as s,a as r,S as d,l as p,n as v}from"./index.2f19b693.js";/* empty css */var c=a({name:"sb-paragraph-edit",model:e,props:{blockId:{type:String,required:!0},data:{type:null,default:n},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(a){const e=l({value:a.data.value,align:a.data.align,focused:!1}),c=t(null),{isActive:f,activate:g}=o(a.blockId),y=()=>{c.value&&f.value&&c.value.focus()};u((()=>{y(),c.value&&(c.value.innerHTML=e.value)})),i(f,y),i((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,c.value&&(c.value.innerHTML=e.value)}));const b=a=>{e.value=a.target.innerHTML},h=s((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),k=n=>{a.onUpdate({value:e.value,align:n.target.value})},m=()=>{e.focused=!0,g()},A=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const l=""+ +new Date;a.onAppendBlock({id:l,name:"sb-paragraph",data:n()}),g(l),e.preventDefault()}},F=n=>{var l;"Backspace"===n.key&&""===e.value&&a.onRemoveSelf();const t=window.getSelection(),o=null==t?void 0:t.focusNode,u=Array.from((null==(l=null==c?void 0:c.value)?void 0:l.childNodes)||[]),i=o?u.indexOf(o):-1;if(o===c.value||0===i||i===u.length-1)switch(n.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>r("div",{class:h.value},[r(d,null,{default:()=>[r(p,{value:e.align,onChange:k},{default:()=>[r("option",null,[v("left")]),r("option",null,[v("center")]),r("option",null,[v("right")])]})]}),r("p",{class:"sb-paragraph__input",ref:c,contenteditable:!0,onInput:b,onFocus:m,onBlur:A,onKeydown:w,onKeyup:F},null)])}});export default c;
|
||||
//# sourceMappingURL=edit.e32652b3.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@
|
|||
<link rel="icon" href="./favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
<script type="module" crossorigin src="./assets/index.2f19b693.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index.db295836.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.73e582b3.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in a new issue