@avocadostudio-ai/cli 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14645,6 +14645,15 @@ var fieldMetaSchema = external_exports.object({
14645
14645
  * label it and no sign that anything had been declared.
14646
14646
  */
14647
14647
  referenceLabelKey: external_exports.string().optional(),
14648
+ /*
14649
+ * Both of these decide whether a surface *mentions* a field, and every one
14650
+ * of those surfaces is on the far side of this boundary — the panel, the
14651
+ * planner's schema summary, the coverage checkers. A key this schema omits
14652
+ * is stripped rather than rejected, so an undeclared flag here means the
14653
+ * declaration silently does nothing where it was supposed to act.
14654
+ */
14655
+ panelOnly: external_exports.boolean().optional(),
14656
+ internal: external_exports.boolean().optional(),
14648
14657
  inline: external_exports.boolean().optional(),
14649
14658
  decorators: external_exports.array(external_exports.object({ name: external_exports.string().min(1), title: external_exports.string().optional() })).optional(),
14650
14659
  required: external_exports.boolean().optional()
@@ -14703,6 +14712,27 @@ var INLINE_PATTERN = new RegExp(
14703
14712
  );
14704
14713
 
14705
14714
  // ../richtext/src/doc.ts
14715
+ var NODE = {
14716
+ doc: "doc",
14717
+ paragraph: "paragraph",
14718
+ heading: "heading",
14719
+ bulletList: "bulletList",
14720
+ orderedList: "orderedList",
14721
+ listItem: "listItem",
14722
+ blockquote: "blockquote",
14723
+ codeBlock: "codeBlock",
14724
+ horizontalRule: "horizontalRule",
14725
+ hardBreak: "hardBreak",
14726
+ text: "text",
14727
+ /**
14728
+ * A block the pivot could not model — a Portable Text `_type` we do not know,
14729
+ * a Contentful embedded entry, a Strapi image. It carries the source object
14730
+ * untouched under `attrs.data` so the converter back out can re-emit it
14731
+ * unchanged. The editor registers a matching read-only node, so it also
14732
+ * survives a trip through the property panel in its original position.
14733
+ */
14734
+ unknown: "avocadoUnknownBlock"
14735
+ };
14706
14736
  var MARK = {
14707
14737
  bold: "bold",
14708
14738
  italic: "italic",
@@ -14751,6 +14781,20 @@ var MARK_TO_FLAG = Object.fromEntries(
14751
14781
  Object.entries(FLAG_TO_MARK).map(([flag, mark]) => [mark, flag])
14752
14782
  );
14753
14783
 
14784
+ // ../richtext/src/storyblok.ts
14785
+ var NODE_IN = {
14786
+ bullet_list: NODE.bulletList,
14787
+ ordered_list: NODE.orderedList,
14788
+ list_item: NODE.listItem,
14789
+ code_block: NODE.codeBlock,
14790
+ horizontal_rule: NODE.horizontalRule,
14791
+ hard_break: NODE.hardBreak,
14792
+ blok: NODE.unknown
14793
+ };
14794
+ var NODE_OUT = Object.fromEntries(
14795
+ Object.entries(NODE_IN).map(([storyblok, pivot]) => [pivot, storyblok])
14796
+ );
14797
+
14754
14798
  // ../shared/src/ops/theme-tokens.ts
14755
14799
  var THEME_TOKEN_TO_CSS_VARS = {
14756
14800
  brandColor: ["--brand", "--brand-hover", "--link"],
@@ -1 +1 @@
1
- import{P as b}from"./chunk-2CNEFIQP-DIGKIfTo.js";import{u as y,a as j,E as L,_ as m,L as M,b as p,o as P,i as A}from"./PuckPrototypeRoute-CAovKdL5.js";import{r as s,j as g}from"./index-5krAO2Jl.js";import{E as N,u as U}from"./index-nC1RD1YE.js";import"./index-CS-vW0iR.js";A();A();function C({content:a,onChange:x,extensions:v,editable:d=!0,onFocusChange:o,name:c}){const[i,E]=P(null,50,{leading:!0,maxWait:200}),l=s.useRef(!1),S=s.useRef(""),f=s.useRef(null),R=!!f.current,_=j(t=>t.state.ui.field.focus===c),T=t=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{S.current===t&&(f.current=null)},200)},u=y(),e=U({extensions:v,content:a,editable:d,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:t})=>{if(l.current||!_){u.getState().setUi({field:{focus:c}});return}const r=t.getHTML(),{from:n,to:h}=t.state.selection;E({from:n,to:h,html:r}),T(r),S.current=r}});return s.useEffect(()=>{if(!e)return;const t=()=>{o==null||o(e)};return e.on("focus",t),()=>{e.off("focus",t)}},[e,o]),s.useEffect(()=>{if(i){const{ui:t}=u.getState().state;x(i.html,{field:m(p({},t.field),{metadata:{from:i.from,to:i.to}})})}},[e,i,x,u,c]),s.useEffect(()=>{e==null||e.setEditable(d)},[e,d]),s.useEffect(()=>{var t;if(!e||R||e.getHTML()===a)return;l.current=!0,e.commands.setContent(a,{emitUpdate:!1});const{ui:n}=u.getState().state;typeof((t=n.field.metadata)==null?void 0:t.from)<"u"&&e.commands.setTextSelection({from:n.field.metadata.from,to:n.field.metadata.to}),l.current=!1},[a,e,u]),e}var F=s.memo(a=>{const{onChange:x,content:v,readOnly:d=!1,field:o,inline:c=!1,onFocus:i,id:E,name:l}=a,{tiptap:S={},options:f}=o,{extensions:R=[]}=S,_=s.useMemo(()=>[b.configure(f),...R],[o,R]),T=y(),u=`${l}${c?"::inline":""}`,e=C({content:v,onChange:x,extensions:_,editable:!d,name:u,onFocusChange:r=>{if(r){const n=T.getState();T.setState({currentRichText:{field:o,editor:r,id:E,inline:c},state:m(p({},n.state),{ui:m(p({},n.state.ui),{field:m(p({},n.state.ui.field),{focus:u})})})}),i==null||i(r)}}}),t=j(r=>{var n,h;return!c&&((n=r.currentRichText)==null?void 0:n.id)===E&&((h=r.currentRichText)!=null&&h.inlineComponentId)?r.currentRichText.editor:e});return e?g.jsx(L,m(p({},a),{editor:e,menu:g.jsx(M,{field:o,editor:t,readOnly:d}),children:g.jsx(N,{editor:e,className:"rich-text"})})):null});F.displayName="Editor";export{F as Editor};
1
+ import{P as b}from"./chunk-2CNEFIQP-Brxm4NMf.js";import{u as y,a as j,E as L,_ as m,L as M,b as p,o as P,i as A}from"./PuckPrototypeRoute-B6iMNdku.js";import{r as s,j as g}from"./index-B4qUKNTV.js";import{E as N,u as U}from"./index-DY7tRaFQ.js";import"./index-CTqfgO94.js";A();A();function C({content:a,onChange:x,extensions:v,editable:d=!0,onFocusChange:o,name:c}){const[i,E]=P(null,50,{leading:!0,maxWait:200}),l=s.useRef(!1),S=s.useRef(""),f=s.useRef(null),R=!!f.current,_=j(t=>t.state.ui.field.focus===c),T=t=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{S.current===t&&(f.current=null)},200)},u=y(),e=U({extensions:v,content:a,editable:d,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:t})=>{if(l.current||!_){u.getState().setUi({field:{focus:c}});return}const r=t.getHTML(),{from:n,to:h}=t.state.selection;E({from:n,to:h,html:r}),T(r),S.current=r}});return s.useEffect(()=>{if(!e)return;const t=()=>{o==null||o(e)};return e.on("focus",t),()=>{e.off("focus",t)}},[e,o]),s.useEffect(()=>{if(i){const{ui:t}=u.getState().state;x(i.html,{field:m(p({},t.field),{metadata:{from:i.from,to:i.to}})})}},[e,i,x,u,c]),s.useEffect(()=>{e==null||e.setEditable(d)},[e,d]),s.useEffect(()=>{var t;if(!e||R||e.getHTML()===a)return;l.current=!0,e.commands.setContent(a,{emitUpdate:!1});const{ui:n}=u.getState().state;typeof((t=n.field.metadata)==null?void 0:t.from)<"u"&&e.commands.setTextSelection({from:n.field.metadata.from,to:n.field.metadata.to}),l.current=!1},[a,e,u]),e}var F=s.memo(a=>{const{onChange:x,content:v,readOnly:d=!1,field:o,inline:c=!1,onFocus:i,id:E,name:l}=a,{tiptap:S={},options:f}=o,{extensions:R=[]}=S,_=s.useMemo(()=>[b.configure(f),...R],[o,R]),T=y(),u=`${l}${c?"::inline":""}`,e=C({content:v,onChange:x,extensions:_,editable:!d,name:u,onFocusChange:r=>{if(r){const n=T.getState();T.setState({currentRichText:{field:o,editor:r,id:E,inline:c},state:m(p({},n.state),{ui:m(p({},n.state.ui),{field:m(p({},n.state.ui.field),{focus:u})})})}),i==null||i(r)}}}),t=j(r=>{var n,h;return!c&&((n=r.currentRichText)==null?void 0:n.id)===E&&((h=r.currentRichText)!=null&&h.inlineComponentId)?r.currentRichText.editor:e});return e?g.jsx(L,m(p({},a),{editor:e,menu:g.jsx(M,{field:o,editor:t,readOnly:d}),children:g.jsx(N,{editor:e,className:"rich-text"})})):null});F.displayName="Editor";export{F as Editor};