@haklex/rich-compose 0.26.6 → 0.27.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/README.md CHANGED
@@ -140,6 +140,7 @@ interface RichEditorModule extends RichRendererModule {
140
140
  editRenderers?: Partial<RendererConfig>; // override renderers in editor mode
141
141
  EditorProvider?: ComponentType<{ children: ReactNode }>; // editor-only provider
142
142
  plugins?: ReactNode; // module-owned editor plugins
143
+ nestedEditorPlugins?: ReactNode; // plugins mounted inside LexicalNestedComposer surfaces
143
144
  actions?: ReactNode; // module-owned action UI
144
145
  }
145
146
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"compose-editor.d.ts","sourceRoot":"","sources":["../../src/core/compose-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,aAAa,EAAwD,MAAM,OAAO,CAAC;AAKjG,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,SAAS,CAAC;AAwCtE,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CAAC,eAAe,CAAC,CA2ExF"}
1
+ {"version":3,"file":"compose-editor.d.ts","sourceRoot":"","sources":["../../src/core/compose-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,aAAa,EAAwD,MAAM,OAAO,CAAC;AAKjG,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,SAAS,CAAC;AAwCtE,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CAAC,eAAe,CAAC,CAiFxF"}
@@ -24,6 +24,7 @@ export interface RichEditorModule extends RichRendererModule {
24
24
  children: ReactNode;
25
25
  }>;
26
26
  editRenderers?: Partial<RendererConfig>;
27
+ nestedEditorPlugins?: ReactNode;
27
28
  plugins?: ReactNode;
28
29
  }
29
30
  export interface ComposeRendererOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;SACrB,CAAC,IAAI,WAAW,GAAG,MAAM,OAAO,CAAC;YAAE,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;SAAE,CAAC;KAC/E,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACxD,aAAa,CAAC,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AAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { a as RichRenderer, i as mergeModules, n as wrapLazy, r as dedupNodes, t
2
2
  import { t as defineConfigurableModule } from "./configurable-module-Bur4JaI3.js";
3
3
  import { Fragment, memo, useCallback, useMemo } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
- import { NestedContentRendererProvider, RichEditor } from "@haklex/rich-editor";
5
+ import { NestedContentRendererProvider, NestedEditorPluginsProvider, RichEditor } from "@haklex/rich-editor";
6
6
  //#region src/core/compose-editor.tsx
7
7
  function mergeSyncRenderers(modules) {
8
8
  const out = {};
@@ -46,9 +46,11 @@ function composeEditor(opts) {
46
46
  const ComposedEditorProviders = composeProviders(merged, "EditorProvider");
47
47
  const modulePlugins = [];
48
48
  const moduleActions = [];
49
+ const nestedEditorPlugins = [];
49
50
  for (const m of merged) {
50
51
  if (m.plugins) modulePlugins.push(/* @__PURE__ */ jsx(Fragment, { children: m.plugins }, `p:${m.name}`));
51
52
  if (m.actions) moduleActions.push(/* @__PURE__ */ jsx(Fragment, { children: m.actions }, `a:${m.name}`));
53
+ if (m.nestedEditorPlugins) nestedEditorPlugins.push(/* @__PURE__ */ jsx(Fragment, { children: m.nestedEditorPlugins }, `nep:${m.name}`));
52
54
  }
53
55
  const NestedRenderer = composeRenderer({
54
56
  preset: opts.preset,
@@ -65,15 +67,18 @@ function composeEditor(opts) {
65
67
  value,
66
68
  variant: overrideVariant ?? variant
67
69
  }), [theme, variant]),
68
- children: /* @__PURE__ */ jsx(ComposedProviders, { children: /* @__PURE__ */ jsx(ComposedEditorProviders, { children: /* @__PURE__ */ jsxs(RichEditor, {
69
- ...rest,
70
- extraNodes: mergedExtraNodes,
71
- rendererConfig: finalConfig,
72
- theme,
73
- variant,
74
- actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [moduleActions, actions] }),
75
- children: [modulePlugins, children]
76
- }) }) })
70
+ children: /* @__PURE__ */ jsx(NestedEditorPluginsProvider, {
71
+ plugins: nestedEditorPlugins,
72
+ children: /* @__PURE__ */ jsx(ComposedProviders, { children: /* @__PURE__ */ jsx(ComposedEditorProviders, { children: /* @__PURE__ */ jsxs(RichEditor, {
73
+ ...rest,
74
+ extraNodes: mergedExtraNodes,
75
+ rendererConfig: finalConfig,
76
+ theme,
77
+ variant,
78
+ actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [moduleActions, actions] }),
79
+ children: [modulePlugins, children]
80
+ }) }) })
81
+ })
77
82
  });
78
83
  }
79
84
  ComposedEditor.displayName = "ComposedEditor";
@@ -3066,7 +3066,12 @@
3066
3066
  width: 60px;
3067
3067
  }
3068
3068
  .gxfui1v {
3069
+ display: block;
3070
+ width: 100%;
3071
+ max-width: 100%;
3072
+ min-width: 0;
3069
3073
  overflow-x: auto;
3074
+ overscroll-behavior-x: contain;
3070
3075
  }
3071
3076
  .gxfui1w {
3072
3077
  border: none;
@@ -4244,7 +4249,12 @@ figure.rich-image[data-layout="float-right"] {
4244
4249
  opacity: 1;
4245
4250
  pointer-events: auto;
4246
4251
  }.icqzyn0 {
4252
+ display: block;
4253
+ width: 100%;
4254
+ max-width: 100%;
4255
+ min-width: 0;
4247
4256
  overflow-x: auto;
4257
+ overscroll-behavior-x: contain;
4248
4258
  }
4249
4259
  .icqzyn1 {
4250
4260
  width: 100%;
@@ -16766,7 +16766,7 @@
16766
16766
  function st$10(t) {
16767
16767
  ot$10 = t.timeStamp;
16768
16768
  }
16769
- function lt$5(t, e, n) {
16769
+ function lt$6(t, e, n) {
16770
16770
  const r = "BR" === t.nodeName, i = e.__lexicalLineBreak;
16771
16771
  return i && (t === i || r && t.previousSibling === i) || r && void 0 !== Ss$2(t, n);
16772
16772
  }
@@ -16815,7 +16815,7 @@
16815
16815
  const e = d.addedNodes;
16816
16816
  for (let n = 0; n < e.length; n++) {
16817
16817
  const r = e[n], i = vs$2(r), s = r.parentNode;
16818
- if (null != s && r !== a && null === i && !lt$5(r, s, t) && !Jl(r)) {
16818
+ if (null != s && r !== a && null === i && !lt$6(r, s, t) && !Jl(r)) {
16819
16819
  if (o$51) {
16820
16820
  const t = (vl(r) ? r.innerText : null) || r.nodeValue;
16821
16821
  t && (f += t);
@@ -16828,7 +16828,7 @@
16828
16828
  let e = 0;
16829
16829
  for (let i = 0; i < r; i++) {
16830
16830
  const r = n[i];
16831
- (lt$5(r, g, t) || a === r) && (g.appendChild(r), e++);
16831
+ (lt$6(r, g, t) || a === r) && (g.appendChild(r), e++);
16832
16832
  }
16833
16833
  r !== e && s.set(p, y);
16834
16834
  }
@@ -16841,7 +16841,7 @@
16841
16841
  const n = d[e], r = n.addedNodes, i = n.target;
16842
16842
  for (let e = 0; e < r.length; e++) {
16843
16843
  const n = r[e], o = n.parentNode;
16844
- null == o || "BR" !== n.nodeName || lt$5(n, i, t) || o.removeChild(n);
16844
+ null == o || "BR" !== n.nodeName || lt$6(n, i, t) || o.removeChild(n);
16845
16845
  }
16846
16846
  }
16847
16847
  n.takeRecords();
@@ -60236,7 +60236,7 @@
60236
60236
  } catch (t) {}
60237
60237
  }
60238
60238
  function pt$6(t, e, n) {
60239
- return rt$9(lt$4, t, e, n);
60239
+ return rt$9(lt$5, t, e, n);
60240
60240
  }
60241
60241
  function gt$6(t) {
60242
60242
  const e = Ke$6(t, ct$6);
@@ -60684,16 +60684,16 @@
60684
60684
  }
60685
60685
  return r;
60686
60686
  }
60687
- var H$7, ct$6, lt$4, ut$4, ft$8, ht$7, vt$5, Jt$5, Xt$4, te$3, ee$4, ne$4, oe$5, se$6, ie$6, be$4, Ce$5, _e$5, Ye$6, un$4, fn$10;
60687
+ var H$7, ct$6, lt$5, ut$4, ft$8, ht$7, vt$5, Jt$5, Xt$4, te$3, ee$4, ne$4, oe$5, se$6, ie$6, be$4, Ce$5, _e$5, Ye$6, un$4, fn$10;
60688
60688
  var init_LexicalHtml_prod = __esmMin((() => {
60689
60689
  init_LexicalSelection_prod();
60690
60690
  init_Lexical_prod();
60691
60691
  init_LexicalUtils_prod();
60692
60692
  init_LexicalExtension_prod();
60693
60693
  init_defineProperty();
60694
- ct$6 = "@lexical/html/DOM", lt$4 = Symbol.for("@lexical/html/DOMExportContext"), ut$4 = "@lexical/html/DOMImport", ft$8 = Symbol.for("@lexical/html/DOMImportContext");
60694
+ ct$6 = "@lexical/html/DOM", lt$5 = Symbol.for("@lexical/html/DOMExportContext"), ut$4 = "@lexical/html/DOMImport", ft$8 = Symbol.for("@lexical/html/DOMImportContext");
60695
60695
  pt$6("root", Boolean), ht$7 = pt$6("isExport", Boolean);
60696
- vt$5 = ot$9(lt$4, gt$6);
60696
+ vt$5 = ot$9(lt$5, gt$6);
60697
60697
  new Map([[xo$2, () => {
60698
60698
  const t = document.createElement("div");
60699
60699
  return t.role = "textbox", { element: t };
@@ -61350,7 +61350,7 @@
61350
61350
  function it$6(t) {
61351
61351
  return t.match(/^[a-z][a-z0-9+.-]*:/i) || t.match(/^[/#.]/) ? t : t.includes("@") ? `mailto:${t}` : rt$7.test(t) ? `tel:${t}` : `https://${t}`;
61352
61352
  }
61353
- function lt$2(t, e) {
61353
+ function lt$3(t, e) {
61354
61354
  return ea$1(t.registerNodeTransform(z$28, G$9), t.registerCommand(tt$7, (t) => {
61355
61355
  const n = e.validateUrl.peek(), r = e.attributes.peek();
61356
61356
  if (null === t) return nt$8(null), !0;
@@ -63245,6 +63245,10 @@
63245
63245
  function ot$4(e) {
63246
63246
  return e instanceof et$5;
63247
63247
  }
63248
+ function lt$2(e) {
63249
+ const t = Hl(e, (e) => Ge$4(e));
63250
+ return Ge$4(t) ? t : null;
63251
+ }
63248
63252
  function Et$2(e, t, n) {
63249
63253
  const [o, r, l] = kt$3(e, t, n);
63250
63254
  return null === r && Ze$5(207), null === l && Ze$5(208), [
@@ -65517,11 +65521,11 @@
65517
65521
  }
65518
65522
  }, [loaded]);
65519
65523
  const placeholderUrl = (0, import_react$167.useMemo)(() => thumbhash ? decodeThumbHash(thumbhash) : void 0, [thumbhash]);
65520
- const aspectStyle = width && height ? {
65521
- aspectRatio: `${width} / ${height}`,
65524
+ const aspectStyle = {
65525
+ ...width && height ? { aspectRatio: `${width} / ${height}` } : {},
65522
65526
  maxWidth: "100%",
65523
- width
65524
- } : { maxWidth: "100%" };
65527
+ width: displayWidth !== void 0 ? "100%" : width && height ? width : void 0
65528
+ };
65525
65529
  return /* @__PURE__ */ (0, import_jsx_runtime$215.jsxs)("figure", {
65526
65530
  className: "rich-image",
65527
65531
  "data-layout": layout,
@@ -65586,6 +65590,29 @@
65586
65590
  OPEN_IMAGE_UPLOAD_DIALOG_COMMAND = ke$6("OPEN_IMAGE_UPLOAD_DIALOG_COMMAND");
65587
65591
  }));
65588
65592
  //#endregion
65593
+ //#region ../rich-editor/src/utils/image-insertion.ts
65594
+ function $getSelectionAnchorNode() {
65595
+ const selection = Ti$1();
65596
+ if (si$1(selection)) return selection.anchor.getNode();
65597
+ if (ci$1(selection)) return selection.getNodes()[0] ?? null;
65598
+ return null;
65599
+ }
65600
+ function $isSelectionInTableCell() {
65601
+ const anchorNode = $getSelectionAnchorNode();
65602
+ return anchorNode ? lt$2(anchorNode) !== null : false;
65603
+ }
65604
+ function $withAdaptiveImageDisplayWidth(payload) {
65605
+ if (payload.displayWidth !== void 0 || !$isSelectionInTableCell()) return payload;
65606
+ return {
65607
+ ...payload,
65608
+ displayWidth: 100
65609
+ };
65610
+ }
65611
+ var init_image_insertion = __esmMin((() => {
65612
+ init_LexicalTable_prod();
65613
+ init_Lexical_prod();
65614
+ }));
65615
+ //#endregion
65589
65616
  //#region ../rich-editor/src/nodes/ImageNode.ts
65590
65617
  function sanitizeImageSrc(src) {
65591
65618
  const trimmed = src.trim();
@@ -65624,6 +65651,7 @@
65624
65651
  init_RendererWrapper();
65625
65652
  init_image_upload_command();
65626
65653
  init_renderer_keys();
65654
+ init_image_insertion();
65627
65655
  init_defineProperty();
65628
65656
  IMAGE_LAYOUTS = [
65629
65657
  "align-left",
@@ -65800,10 +65828,10 @@
65800
65828
  onSelect: (editor) => {
65801
65829
  if (editor.dispatchCommand(OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, void 0)) return;
65802
65830
  editor.update(() => {
65803
- Pi$2([$createImageNode({
65831
+ Pi$2([$createImageNode($withAdaptiveImageDisplayWidth({
65804
65832
  src: "",
65805
65833
  altText: ""
65806
- })]);
65834
+ }))]);
65807
65835
  });
65808
65836
  }
65809
65837
  }]);
@@ -210944,7 +210972,7 @@ ${seriesRules.join("\n")}${tipRules}
210944
210972
  var init_types$2 = __esmMin((() => {}));
210945
210973
  //#endregion
210946
210974
  //#region ../../node_modules/.pnpm/swr@2.4.1_react@19.2.6/node_modules/swr/dist/_internal/index.mjs
210947
- var import_react$144, enableDevtools, use$6, setupDevTools, normalize$3, useSWRConfig, middleware$1, BUILT_IN_MIDDLEWARE, withArgs, subscribeCallback;
210975
+ var import_react$144, enableDevtools, use$7, setupDevTools, normalize$3, useSWRConfig, middleware$1, BUILT_IN_MIDDLEWARE, withArgs, subscribeCallback;
210948
210976
  var init__internal = __esmMin((() => {
210949
210977
  init_config_context_12s_CCVTDPOP();
210950
210978
  init_events();
@@ -210952,7 +210980,7 @@ ${seriesRules.join("\n")}${tipRules}
210952
210980
  import_react$144 = /* @__PURE__ */ __toESM$1(require_react$1(), 1);
210953
210981
  init_types$2();
210954
210982
  enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
210955
- use$6 = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
210983
+ use$7 = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
210956
210984
  setupDevTools = () => {
210957
210985
  if (enableDevtools) window.__SWR_DEVTOOLS_REACT__ = import_react$144.default;
210958
210986
  };
@@ -210982,7 +211010,7 @@ ${seriesRules.join("\n")}${tipRules}
210982
211010
  return req;
210983
211011
  }), config);
210984
211012
  };
210985
- BUILT_IN_MIDDLEWARE = use$6.concat(middleware$1);
211013
+ BUILT_IN_MIDDLEWARE = use$7.concat(middleware$1);
210986
211014
  withArgs = (hook) => {
210987
211015
  return function useSWRArgs(...args) {
210988
211016
  const fallbackConfig = useSWRConfig();
@@ -211007,12 +211035,12 @@ ${seriesRules.join("\n")}${tipRules}
211007
211035
  };
211008
211036
  };
211009
211037
  setupDevTools();
211010
- })), import_react$143, import_shim$1, use$5, WITH_DEDUPE, resolvedUndef, sub$1, useSWRHandler, useSWR$1;
211038
+ })), import_react$143, import_shim$1, use$6, WITH_DEDUPE, resolvedUndef, sub$1, useSWRHandler, useSWR$1;
211011
211039
  var init_index = __esmMin((() => {
211012
211040
  import_react$143 = /* @__PURE__ */ __toESM$1(require_react$1(), 1);
211013
211041
  import_shim$1 = require_shim();
211014
211042
  init__internal();
211015
- use$5 = import_react$143.use || ((thenable) => {
211043
+ use$6 = import_react$143.use || ((thenable) => {
211016
211044
  switch (thenable.status) {
211017
211045
  case "pending": throw thenable;
211018
211046
  case "fulfilled": return thenable.value;
@@ -211102,7 +211130,7 @@ ${seriesRules.join("\n")}${tipRules}
211102
211130
  }), [cache, key]), getSnapshot[0], getSnapshot[1]);
211103
211131
  const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
211104
211132
  const cachedData = cached.data;
211105
- const data = isUndefined$2(cachedData) ? fallback && isPromiseLike$2(fallback) ? use$5(fallback) : fallback : cachedData;
211133
+ const data = isUndefined$2(cachedData) ? fallback && isPromiseLike$2(fallback) ? use$6(fallback) : fallback : cachedData;
211106
211134
  const error = cached.error;
211107
211135
  const laggyDataRef = (0, import_react$143.useRef)(data);
211108
211136
  const returnedData = keepPreviousData ? isUndefined$2(cachedData) ? isUndefined$2(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;
@@ -211279,14 +211307,14 @@ ${seriesRules.join("\n")}${tipRules}
211279
211307
  unmountedRef.current = false;
211280
211308
  }
211281
211309
  const req = PRELOAD[key];
211282
- use$5(!isUndefined$2(req) && hasKeyButNoData ? boundMutate(req) : resolvedUndef);
211310
+ use$6(!isUndefined$2(req) && hasKeyButNoData ? boundMutate(req) : resolvedUndef);
211283
211311
  if (!isUndefined$2(error) && hasKeyButNoData) throw error;
211284
211312
  const revalidation = hasKeyButNoData ? revalidate(WITH_DEDUPE) : resolvedUndef;
211285
211313
  if (!isUndefined$2(returnedData) && hasKeyButNoData) {
211286
211314
  revalidation.status = "fulfilled";
211287
211315
  revalidation.value = true;
211288
211316
  }
211289
- use$5(revalidation);
211317
+ use$6(revalidation);
211290
211318
  }
211291
211319
  return {
211292
211320
  mutate: boundMutate,
@@ -240647,7 +240675,7 @@ or paste into an existing text editor`,
240647
240675
  delay
240648
240676
  ]);
240649
240677
  (0, import_react$136.useDebugValue)(value);
240650
- if (isPromiseLike(value)) return use$3(createContinuablePromise(value));
240678
+ if (isPromiseLike(value)) return use$4(createContinuablePromise(value));
240651
240679
  return value;
240652
240680
  }
240653
240681
  function useSetAtom(atom, options) {
@@ -240659,7 +240687,7 @@ or paste into an existing text editor`,
240659
240687
  function useAtom(atom, options) {
240660
240688
  return [useAtomValue(atom, options), useSetAtom(atom, options)];
240661
240689
  }
240662
- var import_react$136, StoreContext, useStore$1, isPromiseLike, attachPromiseMeta, use$3, continuablePromiseMap, createContinuablePromise;
240690
+ var import_react$136, StoreContext, useStore$1, isPromiseLike, attachPromiseMeta, use$4, continuablePromiseMap, createContinuablePromise;
240663
240691
  var init_react = __esmMin((() => {
240664
240692
  import_react$136 = /* @__PURE__ */ __toESM$1(require_react$1(), 1);
240665
240693
  init_vanilla$1();
@@ -240679,7 +240707,7 @@ or paste into an existing text editor`,
240679
240707
  promise.reason = e;
240680
240708
  });
240681
240709
  };
240682
- use$3 = import_react$136.use || ((promise) => {
240710
+ use$4 = import_react$136.use || ((promise) => {
240683
240711
  if (promise.status === "pending") throw promise;
240684
240712
  else if (promise.status === "fulfilled") return promise.value;
240685
240713
  else if (promise.status === "rejected") throw promise.reason;
@@ -479168,7 +479196,7 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
479168
479196
  backgroundColor: state !== "loaded" && !placeholderUrl ? accent || vars.color.bgTertiary : "transparent",
479169
479197
  backgroundImage: placeholderUrl && state !== "loaded" ? `url(${placeholderUrl})` : void 0,
479170
479198
  backgroundSize: "cover",
479171
- width: width ? Math.min(width, 1200) : void 0,
479199
+ width: displayWidth !== void 0 ? "100%" : width ? Math.min(width, 1200) : void 0,
479172
479200
  maxWidth: "100%",
479173
479201
  ...width && height ? { aspectRatio: `${width} / ${height}` } : {}
479174
479202
  };
@@ -481242,41 +481270,6 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481242
481270
  });
481243
481271
  }
481244
481272
  //#endregion
481245
- //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalLinkPlugin.prod.mjs
481246
- init_LexicalExtension_prod();
481247
- init_LexicalLink_prod();
481248
- init_LexicalComposerContext_prod();
481249
- function l$5({ validateUrl: l, attributes: n }) {
481250
- const [a] = o$52();
481251
- return (0, import_react$183.useEffect)(() => {
481252
- if (!a.hasNodes([z$28])) throw new Error("LinkPlugin: LinkNode not registered on editor");
481253
- }), (0, import_react$183.useEffect)(() => lt$2(a, Wt$7({
481254
- attributes: n,
481255
- validateUrl: l
481256
- })), [
481257
- a,
481258
- l,
481259
- n
481260
- ]), null;
481261
- }
481262
- //#endregion
481263
- //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalListPlugin.prod.mjs
481264
- init_LexicalList_prod();
481265
- init_LexicalComposerContext_prod();
481266
- init_Lexical_prod();
481267
- function l$4({ hasStrictIndent: l = !1, shouldPreserveNumbering: m = !1 }) {
481268
- const [c] = o$52();
481269
- return (0, import_react$183.useEffect)(() => {
481270
- if (!c.hasNodes([Se$3, ye$2])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
481271
- }, [c]), (0, import_react$183.useEffect)(() => ea$1(Be$5(c, { restoreNumbering: m }), l ? We$5(c) : () => {}), [
481272
- c,
481273
- l,
481274
- m
481275
- ]), function(e) {
481276
- (0, import_react$183.useEffect)(() => Be$5(e), [e]);
481277
- }(c), null;
481278
- }
481279
- //#endregion
481280
481273
  //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalCollaborationContext.prod.mjs
481281
481274
  /**
481282
481275
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -481302,12 +481295,12 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481302
481295
  ["Owl", "rgb(0, 100, 100)"],
481303
481296
  ["Gull", "rgb(100, 0, 100)"],
481304
481297
  ["Squid", "rgb(150, 0, 150)"]
481305
- ], i$2 = t$1[Math.floor(Math.random() * t$1.length)], l$3 = (0, import_react$183.createContext)(null);
481298
+ ], i$3 = t$1[Math.floor(Math.random() * t$1.length)], l$5 = (0, import_react$183.createContext)(null);
481306
481299
  function a$3() {
481307
481300
  return {
481308
- color: i$2[1],
481301
+ color: i$3[1],
481309
481302
  isCollabActive: !1,
481310
- name: i$2[0],
481303
+ name: i$3[0],
481311
481304
  yjsDocMap: /* @__PURE__ */ new Map()
481312
481305
  };
481313
481306
  }
@@ -481367,7 +481360,7 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481367
481360
  });
481368
481361
  }
481369
481362
  return [m, t];
481370
- }, []), { isCollabActive: L, yjsDocMap: M } = (0, import_react$183.useContext)(l$3) ?? {}, y = x || v.current || M && M.has(m.getKey());
481363
+ }, []), { isCollabActive: L, yjsDocMap: M } = (0, import_react$183.useContext)(l$5) ?? {}, y = x || v.current || M && M.has(m.getKey());
481371
481364
  return (0, import_react$183.useEffect)(() => {
481372
481365
  y && (v.current = !0);
481373
481366
  }, [y]), (0, import_react$183.useEffect)(() => {
@@ -481395,7 +481388,7 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481395
481388
  subscribe: (t) => r.registerEditableListener(t)
481396
481389
  };
481397
481390
  }
481398
- function l$1() {
481391
+ function l$3() {
481399
481392
  return function(t) {
481400
481393
  const [e] = o$52(), o = (0, import_react$183.useMemo)(() => t(e), [e, t]), [a, l] = (0, import_react$183.useState)(() => o.initialValueFn()), s = (0, import_react$183.useRef)(a);
481401
481394
  return u$1(() => {
@@ -481497,10 +481490,61 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481497
481490
  e();
481498
481491
  }));
481499
481492
  }, [r]), e;
481500
- }(o), i = l$1();
481493
+ }(o), i = l$3();
481501
481494
  return n ? "function" == typeof t ? t(i) : t : null;
481502
481495
  }
481503
481496
  //#endregion
481497
+ //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalLinkPlugin.prod.mjs
481498
+ init_LexicalExtension_prod();
481499
+ init_LexicalLink_prod();
481500
+ init_LexicalComposerContext_prod();
481501
+ function l$1({ validateUrl: l, attributes: n }) {
481502
+ const [a] = o$52();
481503
+ return (0, import_react$183.useEffect)(() => {
481504
+ if (!a.hasNodes([z$28])) throw new Error("LinkPlugin: LinkNode not registered on editor");
481505
+ }), (0, import_react$183.useEffect)(() => lt$3(a, Wt$7({
481506
+ attributes: n,
481507
+ validateUrl: l
481508
+ })), [
481509
+ a,
481510
+ l,
481511
+ n
481512
+ ]), null;
481513
+ }
481514
+ //#endregion
481515
+ //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalListPlugin.prod.mjs
481516
+ init_LexicalList_prod();
481517
+ init_LexicalComposerContext_prod();
481518
+ init_Lexical_prod();
481519
+ function l({ hasStrictIndent: l = !1, shouldPreserveNumbering: m = !1 }) {
481520
+ const [c] = o$52();
481521
+ return (0, import_react$183.useEffect)(() => {
481522
+ if (!c.hasNodes([Se$3, ye$2])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
481523
+ }, [c]), (0, import_react$183.useEffect)(() => ea$1(Be$5(c, { restoreNumbering: m }), l ? We$5(c) : () => {}), [
481524
+ c,
481525
+ l,
481526
+ m
481527
+ ]), function(e) {
481528
+ (0, import_react$183.useEffect)(() => Be$5(e), [e]);
481529
+ }(c), null;
481530
+ }
481531
+ //#endregion
481532
+ //#region ../rich-editor/src/context/NestedEditorPluginsContext.tsx
481533
+ var NestedEditorPluginsContext = (0, import_react$183.createContext)(null);
481534
+ function useNestedEditorPlugins() {
481535
+ return (0, import_react$183.use)(NestedEditorPluginsContext)?.plugins ?? null;
481536
+ }
481537
+ //#endregion
481538
+ //#region ../rich-editor/src/components/decorators/NestedEditorCorePlugins.tsx
481539
+ function NestedEditorCorePlugins() {
481540
+ const nestedEditorPlugins = useNestedEditorPlugins();
481541
+ return /* @__PURE__ */ (0, import_jsx_runtime$232.jsxs)(import_jsx_runtime$232.Fragment, { children: [
481542
+ /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(l, {}),
481543
+ /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(l$1, {}),
481544
+ nestedEditorPlugins
481545
+ ] });
481546
+ }
481547
+ //#endregion
481504
481548
  //#region ../rich-editor/src/components/decorators/AlertEditDecorator.tsx
481505
481549
  init_LexicalComposerContext_prod();
481506
481550
  init_Lexical_prod();
@@ -481613,8 +481657,7 @@ TTD mermaid definition render errror: ${M.message}`, "color: yellow"), le("ai",
481613
481657
  style: { outline: "none" }
481614
481658
  })
481615
481659
  }),
481616
- /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(l$4, {}),
481617
- /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(l$5, {}),
481660
+ /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(NestedEditorCorePlugins, {}),
481618
481661
  /* @__PURE__ */ (0, import_jsx_runtime$232.jsx)(ExitBlockPlugin, {
481619
481662
  nodeKey,
481620
481663
  parentEditor: editor
@@ -1 +1 @@
1
- {"version":3,"file":"table.css.d.ts","sourceRoot":"","sources":["../../src/static-renderer/table.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,QAEvB,CAAC;AAEH,eAAO,MAAM,KAAK,QAKhB,CAAC;AAEH,eAAO,MAAM,SAAS,QAQpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAIpB,CAAC"}
1
+ {"version":3,"file":"table.css.d.ts","sourceRoot":"","sources":["../../src/static-renderer/table.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,QAOvB,CAAC;AAEH,eAAO,MAAM,KAAK,QAKhB,CAAC;AAEH,eAAO,MAAM,SAAS,QAQpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAIpB,CAAC"}