@avocadostudio-ai/cli 0.23.0 → 0.24.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/editor-dist/assets/{Editor-EPSED64A-D-sBiw-8.js → Editor-EPSED64A-DSDEiRED.js} +1 -1
- package/editor-dist/assets/{PuckPrototypeRoute-Dx-xufOJ.js → PuckPrototypeRoute-BMFSrgRi.js} +4 -4
- package/editor-dist/assets/{Render-CU35UAWV-DWjlpqsm.js → Render-CU35UAWV-DwHP8lh1.js} +1 -1
- package/editor-dist/assets/{chunk-2CNEFIQP-BRBuvhWZ.js → chunk-2CNEFIQP-BCM0jyMr.js} +1 -1
- package/editor-dist/assets/{full-N67EAB2Q-DvrZoMmo.js → full-N67EAB2Q-D5lL4Hzv.js} +1 -1
- package/editor-dist/assets/{index-O13fkYtd.js → index-BWf4GeHX.js} +186 -186
- package/editor-dist/assets/{index-CEEXZHeP.css → index-C22KfTbY.css} +1 -1
- package/editor-dist/assets/{index-OxTwE7p9.js → index-C8b9WNzA.js} +1 -1
- package/editor-dist/assets/{index-B_NrVmV6.js → index-DxOQxIUC.js} +1 -1
- package/editor-dist/assets/{loaded-F37CNCVG-Bvn3tf2j.js → loaded-F37CNCVG-CtYRHm7U.js} +1 -1
- package/editor-dist/assets/{loaded-H325ZSK5-B0UCUerJ.js → loaded-H325ZSK5-C90KZEtp.js} +1 -1
- package/editor-dist/assets/{loaded-MIY725CK-a74YyvMW.js → loaded-MIY725CK-CIJzAlVB.js} +1 -1
- package/editor-dist/index.html +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as b}from"./chunk-2CNEFIQP-
|
|
1
|
+
import{P as b}from"./chunk-2CNEFIQP-BCM0jyMr.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-BMFSrgRi.js";import{r as s,j as g}from"./index-BWf4GeHX.js";import{E as N,u as U}from"./index-DxOQxIUC.js";import"./index-C8b9WNzA.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};
|