@wipco/sdui-editor 0.17.1 → 0.18.1

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { lazy, Suspense, useState, useCallback, useEffect, useMemo, useRef, useLayoutEffect, useDeferredValue, useReducer, useId } from 'react';
2
- import { defaultRegistry, createRegistry, Tooltip, SidebarNav, SegmentedControl, Radio, Breadcrumb, Avatar, Alert, Icon, IconButton, Spinner, Button, Card, Tabs, Input, Badge, EmptyState, Table, SduiDialog, Field, Select, validateSpec, SduiRenderer, Checkbox, Switch, Dialog, Textarea } from '@wipco/sdui';
2
+ import { defaultRegistry, createRegistry, Tooltip, SidebarNav, SegmentedControl, Radio, Breadcrumb, Avatar, Alert, Icon, IconButton, Spinner, Button, Card, Tabs, Input, Badge, EmptyState, Table, SduiDialog, Field, Select, validateSpec, SduiRenderer, Checkbox, Switch, OverlayContainerContext, Dialog, Textarea } from '@wipco/sdui';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { EditorView, basicSetup } from 'codemirror';
5
5
  import { EditorState } from '@codemirror/state';
@@ -10091,6 +10091,11 @@ function EditorView2({
10091
10091
  const [corrupt, setCorrupt] = useState(false);
10092
10092
  const [draftRestored, setDraftRestored] = useState(false);
10093
10093
  const [helpOpen, setHelpOpen] = useState(false);
10094
+ const previewBodyRef = useRef(null);
10095
+ const [previewBody, setPreviewBody] = useState(null);
10096
+ useEffect(() => {
10097
+ setPreviewBody(previewBodyRef.current);
10098
+ }, []);
10094
10099
  const [previewKey, setPreviewKey] = useState(0);
10095
10100
  const [previewNotice, setPreviewNotice] = useState(null);
10096
10101
  const noticeTimer = useRef(null);
@@ -10577,7 +10582,7 @@ function EditorView2({
10577
10582
  onClose: () => setSeedPanelOpen(false)
10578
10583
  }
10579
10584
  ) : null,
10580
- /* @__PURE__ */ jsx("div", { className: "sdui-editor-preview__body", children: previewPage ? /* @__PURE__ */ jsx(
10585
+ /* @__PURE__ */ jsx("div", { className: "sdui-editor-preview__body", ref: previewBodyRef, children: /* @__PURE__ */ jsx(OverlayContainerContext.Provider, { value: previewBody, children: previewPage ? /* @__PURE__ */ jsx(
10581
10586
  PreviewBoundary,
10582
10587
  {
10583
10588
  resetKey: previewKey,
@@ -10594,7 +10599,7 @@ function EditorView2({
10594
10599
  `${previewKey}:${seedSignature(seeds)}`
10595
10600
  )
10596
10601
  }
10597
- ) : /* @__PURE__ */ jsx(Alert, { tone: parsed.error ? "warning" : "neutral", children: parsed.error ? "JSON\uC744 \uACE0\uCE58\uBA74 \uBBF8\uB9AC\uBCF4\uAE30\uAC00 \uB2E4\uC2DC \uADF8\uB824\uC9D1\uB2C8\uB2E4." : "\uC2A4\uD399\uC744 \uC785\uB825\uD558\uC138\uC694." }) })
10602
+ ) : /* @__PURE__ */ jsx(Alert, { tone: parsed.error ? "warning" : "neutral", children: parsed.error ? "JSON\uC744 \uACE0\uCE58\uBA74 \uBBF8\uB9AC\uBCF4\uAE30\uAC00 \uB2E4\uC2DC \uADF8\uB824\uC9D1\uB2C8\uB2E4." : "\uC2A4\uD399\uC744 \uC785\uB825\uD558\uC138\uC694." }) }) })
10598
10603
  ] }),
10599
10604
  helpOpen ? /* @__PURE__ */ jsx(HelpPanel, { onClose: () => setHelpOpen(false) }) : null
10600
10605
  ] })
@@ -10653,6 +10658,11 @@ function ViewerView({
10653
10658
  load();
10654
10659
  }, [id, load]);
10655
10660
  const [blocked, setBlocked] = useState(null);
10661
+ const viewerBodyRef = useRef(null);
10662
+ const [viewerBody, setViewerBody] = useState(null);
10663
+ useEffect(() => {
10664
+ setViewerBody(viewerBodyRef.current);
10665
+ }, []);
10656
10666
  const blockedTimer = useRef(null);
10657
10667
  const notifyBlocked = useCallback((what) => {
10658
10668
  setBlocked(`${what} \u2014 \uBCF4\uAE30\uC5D0\uC11C\uB294 \uC2E4\uD589\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4`);
@@ -10741,7 +10751,7 @@ function ViewerView({
10741
10751
  onClose: () => setSeedPanelOpen(false)
10742
10752
  }
10743
10753
  ) : null,
10744
- /* @__PURE__ */ jsx("div", { className: "sdui-editor-viewer__body", children: state.error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", title: "\uD398\uC774\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4", children: state.error }) : !state.spec ? /* @__PURE__ */ jsx("div", { className: "sdui-editor-center", style: { padding: 64 }, children: /* @__PURE__ */ jsx(Spinner, { size: "lg", label: "\uBD88\uB7EC\uC624\uB294 \uC911" }) }) : /* @__PURE__ */ jsx(
10754
+ /* @__PURE__ */ jsx("div", { className: "sdui-editor-viewer__body", ref: viewerBodyRef, children: /* @__PURE__ */ jsx(OverlayContainerContext.Provider, { value: viewerBody, children: state.error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", title: "\uD398\uC774\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4", children: state.error }) : !state.spec ? /* @__PURE__ */ jsx("div", { className: "sdui-editor-center", style: { padding: 64 }, children: /* @__PURE__ */ jsx(Spinner, { size: "lg", label: "\uBD88\uB7EC\uC624\uB294 \uC911" }) }) : /* @__PURE__ */ jsx(
10745
10755
  ViewerBoundary,
10746
10756
  {
10747
10757
  resetKey: `${id}#${state.seq}`,
@@ -10774,7 +10784,7 @@ function ViewerView({
10774
10784
  `${id}#${state.seq}:${seedSignature(seeds)}`
10775
10785
  )
10776
10786
  }
10777
- ) })
10787
+ ) }) })
10778
10788
  ] });
10779
10789
  }
10780
10790
  function SduiEditor({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipco/sdui-editor",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
4
4
  "description": "SDUI 페이지 스펙 편집기 — 소비 프로젝트가 자기 라우트에 마운트하는 React 컴포넌트",
5
5
  "keywords": [
6
6
  "sdui",
@@ -58,14 +58,14 @@
58
58
  "codemirror": "^6.0.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@wipco/sdui": "^0.17.0",
61
+ "@wipco/sdui": "^0.18.1",
62
62
  "react": ">=18",
63
63
  "react-dom": ">=18"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/react": "^19.0.0",
67
67
  "@types/react-dom": "^19.0.0",
68
- "@wipco/sdui": "^0.17.0",
68
+ "@wipco/sdui": "^0.18.1",
69
69
  "tsup": "^8.5.0",
70
70
  "tsx": "^4.20.0",
71
71
  "typescript": "^5.7.0"