@wipco/sdui 0.25.0 → 0.26.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.
@@ -1,137 +1,10 @@
1
+ import { useOverlayLayer, OverlayContainerContext, getOverlayRoot } from './chunk-XQPTSEJC.js';
1
2
  import { Icon } from './chunk-WIDDHR7L.js';
2
3
  import { boxed } from './chunk-SAN4IX6N.js';
3
- import React, { useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, useSyncExternalStore } from 'react';
4
- import { createPortal } from 'react-dom';
4
+ import React, { useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
+ import { createPortal } from 'react-dom';
6
7
 
7
- var OVERLAY_ROOT_ID = "wp-overlay-root";
8
- var DOCUMENT_POSITION_FOLLOWING = 4;
9
- function getOverlayRoot() {
10
- if (typeof document === "undefined") return null;
11
- const existing = document.getElementById(OVERLAY_ROOT_ID);
12
- if (existing) return existing;
13
- const created = document.createElement("div");
14
- created.id = OVERLAY_ROOT_ID;
15
- document.body.appendChild(created);
16
- return created;
17
- }
18
- var layers = [];
19
- var nextId = 0;
20
- var subscribers = /* @__PURE__ */ new Set();
21
- var keyListenerBound = false;
22
- function emit() {
23
- layers = layers.slice();
24
- subscribers.forEach((fn) => fn());
25
- }
26
- function topLayer(list) {
27
- let best;
28
- let bestNode = null;
29
- for (const layer of list) {
30
- const node = layer.node();
31
- if (!best) {
32
- best = layer;
33
- bestNode = node;
34
- continue;
35
- }
36
- if (!node) continue;
37
- if (!bestNode) {
38
- best = layer;
39
- bestNode = node;
40
- continue;
41
- }
42
- if (bestNode.compareDocumentPosition(node) & DOCUMENT_POSITION_FOLLOWING) {
43
- best = layer;
44
- bestNode = node;
45
- }
46
- }
47
- return best;
48
- }
49
- function layerHoldsTop(list, id) {
50
- const top = topLayer(list);
51
- if (!top) return false;
52
- if (top.id === id) return true;
53
- const mine = list.find((l) => l.id === id)?.node();
54
- const topNode = top.node();
55
- return !!mine && !!topNode && mine.contains(topNode);
56
- }
57
- function escapeTopmost() {
58
- topLayer(layers)?.onEscape();
59
- }
60
- function handleKeyDown(event) {
61
- if (event.key !== "Escape") return;
62
- escapeTopmost();
63
- }
64
- function push(layer) {
65
- layers.push(layer);
66
- if (!keyListenerBound && typeof document !== "undefined") {
67
- document.addEventListener("keydown", handleKeyDown);
68
- keyListenerBound = true;
69
- }
70
- emit();
71
- }
72
- function remove(id) {
73
- layers = layers.filter((l) => l.id !== id);
74
- emit();
75
- }
76
- function subscribe(fn) {
77
- subscribers.add(fn);
78
- return () => {
79
- subscribers.delete(fn);
80
- };
81
- }
82
- var snapshot = () => layers;
83
- var serverSnapshot = () => [];
84
- function useOverlayLayer(active, onEscape, nodeRef) {
85
- const idRef = useRef(0);
86
- if (idRef.current === 0) idRef.current = ++nextId;
87
- const escapeRef = useRef(onEscape);
88
- escapeRef.current = onEscape;
89
- const nodeRefRef = useRef(nodeRef);
90
- nodeRefRef.current = nodeRef;
91
- useEffect(() => {
92
- if (!active) return;
93
- const id2 = idRef.current;
94
- push({
95
- id: id2,
96
- onEscape: () => escapeRef.current?.(),
97
- node: () => nodeRefRef.current?.current ?? null
98
- });
99
- return () => remove(id2);
100
- }, [active]);
101
- const current = useSyncExternalStore(subscribe, snapshot, serverSnapshot);
102
- const id = idRef.current;
103
- return {
104
- isTop: active && topLayer(current)?.id === id,
105
- holdsTop: active && layerHoldsTop(current, id)
106
- };
107
- }
108
- var OverlayContainerContext = React.createContext(null);
109
- function OverlayLayer({
110
- onClose,
111
- children
112
- }) {
113
- const ref = useRef(null);
114
- const container = React.useContext(OverlayContainerContext);
115
- const { holdsTop } = useOverlayLayer(true, onClose, ref);
116
- useEffect(() => {
117
- ref.current?.toggleAttribute("inert", !holdsTop);
118
- }, [holdsTop]);
119
- const layer = /* @__PURE__ */ jsx(
120
- "div",
121
- {
122
- ref,
123
- className: "wp-overlay-layer",
124
- onClick: (event) => {
125
- if (onClose && event.target instanceof HTMLElement && event.target.classList.contains("wp-overlay")) {
126
- onClose();
127
- }
128
- },
129
- children
130
- }
131
- );
132
- const root = container ?? getOverlayRoot();
133
- return root ? createPortal(layer, root) : layer;
134
- }
135
8
  function HoistedStyle({ id, css }) {
136
9
  return /* @__PURE__ */ jsx("style", { href: id, precedence: "medium", children: css });
137
10
  }
@@ -357,7 +230,7 @@ function Calendar({
357
230
  const moveFocus = (next) => {
358
231
  onFocusDateChange(clampDate(next, minDate, maxDate));
359
232
  };
360
- const handleKeyDown2 = (event) => {
233
+ const handleKeyDown = (event) => {
361
234
  const deltaDays = event.key === "ArrowLeft" ? -1 : event.key === "ArrowRight" ? 1 : event.key === "ArrowUp" ? -7 : event.key === "ArrowDown" ? 7 : 0;
362
235
  if (deltaDays !== 0) {
363
236
  event.preventDefault();
@@ -375,7 +248,7 @@ function Calendar({
375
248
  moveFocus(addMonths(focusDate, event.key === "PageUp" ? -1 : 1));
376
249
  }
377
250
  };
378
- return /* @__PURE__ */ jsx("div", { className: "wp-dp", children: /* @__PURE__ */ jsxs("div", { className: "wp-dp__months", ref: gridRef, onKeyDown: handleKeyDown2, children: [
251
+ return /* @__PURE__ */ jsx("div", { className: "wp-dp", children: /* @__PURE__ */ jsxs("div", { className: "wp-dp__months", ref: gridRef, onKeyDown: handleKeyDown, children: [
379
252
  /* @__PURE__ */ jsxs("div", { className: "wp-dp__nav", children: [
380
253
  /* @__PURE__ */ jsx(
381
254
  "button",
@@ -553,7 +426,7 @@ function DatePickerImpl({
553
426
  }
554
427
  commit(next);
555
428
  };
556
- const handleKeyDown2 = (event) => {
429
+ const handleKeyDown = (event) => {
557
430
  if (event.key === "ArrowDown") {
558
431
  event.preventDefault();
559
432
  if (open) popRef.current?.querySelector('[tabindex="0"]')?.focus();
@@ -586,7 +459,7 @@ function DatePickerImpl({
586
459
  lead: true,
587
460
  expanded: open,
588
461
  onValueChange: handleTextChange,
589
- onKeyDown: handleKeyDown2,
462
+ onKeyDown: handleKeyDown,
590
463
  onPointerDown: () => {
591
464
  if (!disabled && !open) openCalendar(false);
592
465
  }
@@ -706,7 +579,7 @@ function DateRangePickerImpl({
706
579
  commit(fromDate && parsed.getTime() < fromDate.getTime() ? "" : fromValue, masked);
707
580
  }
708
581
  };
709
- const handleKeyDown2 = (which) => (event) => {
582
+ const handleKeyDown = (which) => (event) => {
710
583
  if (event.key === "ArrowDown") {
711
584
  event.preventDefault();
712
585
  if (open) popRef.current?.querySelector('[tabindex="0"]')?.focus();
@@ -761,7 +634,7 @@ function DateRangePickerImpl({
761
634
  expanded: open,
762
635
  ariaLabel: "\uC2DC\uC791\uC77C",
763
636
  onValueChange: (raw) => handleTextChange("from", raw),
764
- onKeyDown: handleKeyDown2("from"),
637
+ onKeyDown: handleKeyDown("from"),
765
638
  onFocus: () => setEnd("from"),
766
639
  onPointerDown: () => {
767
640
  if (!disabled && !open) openCalendar("from", false);
@@ -783,7 +656,7 @@ function DateRangePickerImpl({
783
656
  expanded: open,
784
657
  ariaLabel: "\uC885\uB8CC\uC77C",
785
658
  onValueChange: (raw) => handleTextChange("to", raw),
786
- onKeyDown: handleKeyDown2("to"),
659
+ onKeyDown: handleKeyDown("to"),
787
660
  onFocus: () => setEnd("to"),
788
661
  onPointerDown: () => {
789
662
  if (!disabled && !open) openCalendar("to", false);
@@ -872,4 +745,4 @@ var DP_CSS = `
872
745
  var DatePicker = boxed(DatePickerImpl, "DatePicker");
873
746
  var DateRangePicker = boxed(DateRangePickerImpl, "DateRangePicker");
874
747
 
875
- export { AnchoredPopoverStyles, DatePicker, DateRangePicker, HoistedStyle, OverlayContainerContext, OverlayLayer, anchorStyle, focusStaysInside, getOverlayRoot, useDismiss, useOverlayLayer, usePopoverAnchor, usePortalTo };
748
+ export { AnchoredPopoverStyles, DatePicker, DateRangePicker, HoistedStyle, anchorStyle, focusStaysInside, useDismiss, usePopoverAnchor, usePortalTo };
@@ -1,4 +1,4 @@
1
- import { DateRangePicker } from './chunk-XKLUCUVA.js';
1
+ import { DateRangePicker } from './chunk-EFMKWPZ3.js';
2
2
  import { SegmentedControl, Select } from './chunk-WIDDHR7L.js';
3
3
  import { boxed } from './chunk-SAN4IX6N.js';
4
4
  import { useState, useMemo } from 'react';
@@ -0,0 +1,39 @@
1
+ import { OverlayLayer } from './chunk-XQPTSEJC.js';
2
+ import { Dialog, warnOnce } from './chunk-WIDDHR7L.js';
3
+ import { createContext, useContext, useMemo } from 'react';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var SduiDispatchContext = createContext(null);
7
+ function useSduiDispatch() {
8
+ const dispatch = useContext(SduiDispatchContext);
9
+ if (!dispatch) {
10
+ throw new Error("useSduiDispatch\uB294 SduiRenderer \uB0B4\uBD80\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
11
+ }
12
+ return dispatch;
13
+ }
14
+ var ALLOW_ALL = () => true;
15
+ var DENY_ALL = () => false;
16
+ var MISSING = () => {
17
+ warnOnce(
18
+ "permission:missing",
19
+ '[sdui] \uAD8C\uD55C \uD310\uC815(can)\uC774 \uC8FC\uC785\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4 \u2014 <Can>\uC774 \uC804\uBD80 \uD1B5\uACFC\uD569\uB2C8\uB2E4. SduiRenderer\uC5D0 can \uCF5C\uBC31\uC744 \uB118\uAE30\uAC70\uB098, \uC138\uC158\uC774 \uC5C6\uB294 \uBBF8\uB9AC\uBCF4\uAE30\uB77C\uBA74 can="allow-all"\uC744 \uBA85\uC2DC\uD558\uC138\uC694.'
20
+ );
21
+ return true;
22
+ };
23
+ var SduiPermissionContext = createContext(null);
24
+ function SduiPermissionProvider({ can, children }) {
25
+ const value = useMemo(() => {
26
+ if (can === "allow-all") return ALLOW_ALL;
27
+ if (can === "deny-all") return DENY_ALL;
28
+ return typeof can === "function" ? can : null;
29
+ }, [can]);
30
+ return /* @__PURE__ */ jsx(SduiPermissionContext.Provider, { value, children });
31
+ }
32
+ function useSduiCan() {
33
+ return useContext(SduiPermissionContext) ?? MISSING;
34
+ }
35
+ function SduiDialog(props) {
36
+ return /* @__PURE__ */ jsx(OverlayLayer, { onClose: props.onClose, children: /* @__PURE__ */ jsx(Dialog, { ...props }) });
37
+ }
38
+
39
+ export { SduiDialog, SduiDispatchContext, SduiPermissionProvider, useSduiCan, useSduiDispatch };
@@ -1,5 +1,5 @@
1
- import { resolveTreeNodes, TreeView } from './chunk-IDUN2ESE.js';
2
- import { OverlayLayer } from './chunk-XKLUCUVA.js';
1
+ import { resolveTreeNodes, TreeView } from './chunk-X5R2HHEN.js';
2
+ import { OverlayLayer } from './chunk-XQPTSEJC.js';
3
3
  import { Field, Dialog, Icon, Button, Input } from './chunk-WIDDHR7L.js';
4
4
  import { boxed } from './chunk-SAN4IX6N.js';
5
5
  import { useState, useMemo, useEffect } from 'react';
@@ -1,4 +1,4 @@
1
- import { useDismiss, usePopoverAnchor, usePortalTo, HoistedStyle, AnchoredPopoverStyles, anchorStyle, focusStaysInside } from './chunk-XKLUCUVA.js';
1
+ import { useDismiss, usePopoverAnchor, usePortalTo, HoistedStyle, AnchoredPopoverStyles, anchorStyle, focusStaysInside } from './chunk-EFMKWPZ3.js';
2
2
  import { Icon, Spinner, EmptyState } from './chunk-WIDDHR7L.js';
3
3
  import { boxed } from './chunk-SAN4IX6N.js';
4
4
  import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
@@ -1,4 +1,4 @@
1
- import { buildCascadingTree } from './chunk-U7ZK7WYH.js';
1
+ import { buildCascadingTree } from './chunk-BD75U73S.js';
2
2
  import { Input, IconButton, EmptyState, Icon, Badge } from './chunk-WIDDHR7L.js';
3
3
  import { boxed } from './chunk-SAN4IX6N.js';
4
4
  import React, { useMemo, useState, useRef, useEffect } from 'react';
@@ -0,0 +1,135 @@
1
+ import React, { useRef, useEffect, useSyncExternalStore } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/overlay.tsx
6
+ var OVERLAY_ROOT_ID = "wp-overlay-root";
7
+ var DOCUMENT_POSITION_FOLLOWING = 4;
8
+ function getOverlayRoot() {
9
+ if (typeof document === "undefined") return null;
10
+ const existing = document.getElementById(OVERLAY_ROOT_ID);
11
+ if (existing) return existing;
12
+ const created = document.createElement("div");
13
+ created.id = OVERLAY_ROOT_ID;
14
+ document.body.appendChild(created);
15
+ return created;
16
+ }
17
+ var layers = [];
18
+ var nextId = 0;
19
+ var subscribers = /* @__PURE__ */ new Set();
20
+ var keyListenerBound = false;
21
+ function emit() {
22
+ layers = layers.slice();
23
+ subscribers.forEach((fn) => fn());
24
+ }
25
+ function topLayer(list) {
26
+ let best;
27
+ let bestNode = null;
28
+ for (const layer of list) {
29
+ const node = layer.node();
30
+ if (!best) {
31
+ best = layer;
32
+ bestNode = node;
33
+ continue;
34
+ }
35
+ if (!node) continue;
36
+ if (!bestNode) {
37
+ best = layer;
38
+ bestNode = node;
39
+ continue;
40
+ }
41
+ if (bestNode.compareDocumentPosition(node) & DOCUMENT_POSITION_FOLLOWING) {
42
+ best = layer;
43
+ bestNode = node;
44
+ }
45
+ }
46
+ return best;
47
+ }
48
+ function layerHoldsTop(list, id) {
49
+ const top = topLayer(list);
50
+ if (!top) return false;
51
+ if (top.id === id) return true;
52
+ const mine = list.find((l) => l.id === id)?.node();
53
+ const topNode = top.node();
54
+ return !!mine && !!topNode && mine.contains(topNode);
55
+ }
56
+ function escapeTopmost() {
57
+ topLayer(layers)?.onEscape();
58
+ }
59
+ function handleKeyDown(event) {
60
+ if (event.key !== "Escape") return;
61
+ escapeTopmost();
62
+ }
63
+ function push(layer) {
64
+ layers.push(layer);
65
+ if (!keyListenerBound && typeof document !== "undefined") {
66
+ document.addEventListener("keydown", handleKeyDown);
67
+ keyListenerBound = true;
68
+ }
69
+ emit();
70
+ }
71
+ function remove(id) {
72
+ layers = layers.filter((l) => l.id !== id);
73
+ emit();
74
+ }
75
+ function subscribe(fn) {
76
+ subscribers.add(fn);
77
+ return () => {
78
+ subscribers.delete(fn);
79
+ };
80
+ }
81
+ var snapshot = () => layers;
82
+ var serverSnapshot = () => [];
83
+ function useOverlayLayer(active, onEscape, nodeRef) {
84
+ const idRef = useRef(0);
85
+ if (idRef.current === 0) idRef.current = ++nextId;
86
+ const escapeRef = useRef(onEscape);
87
+ escapeRef.current = onEscape;
88
+ const nodeRefRef = useRef(nodeRef);
89
+ nodeRefRef.current = nodeRef;
90
+ useEffect(() => {
91
+ if (!active) return;
92
+ const id2 = idRef.current;
93
+ push({
94
+ id: id2,
95
+ onEscape: () => escapeRef.current?.(),
96
+ node: () => nodeRefRef.current?.current ?? null
97
+ });
98
+ return () => remove(id2);
99
+ }, [active]);
100
+ const current = useSyncExternalStore(subscribe, snapshot, serverSnapshot);
101
+ const id = idRef.current;
102
+ return {
103
+ isTop: active && topLayer(current)?.id === id,
104
+ holdsTop: active && layerHoldsTop(current, id)
105
+ };
106
+ }
107
+ var OverlayContainerContext = React.createContext(null);
108
+ function OverlayLayer({
109
+ onClose,
110
+ children
111
+ }) {
112
+ const ref = useRef(null);
113
+ const container = React.useContext(OverlayContainerContext);
114
+ const { holdsTop } = useOverlayLayer(true, onClose, ref);
115
+ useEffect(() => {
116
+ ref.current?.toggleAttribute("inert", !holdsTop);
117
+ }, [holdsTop]);
118
+ const layer = /* @__PURE__ */ jsx(
119
+ "div",
120
+ {
121
+ ref,
122
+ className: "wp-overlay-layer",
123
+ onClick: (event) => {
124
+ if (onClose && event.target instanceof HTMLElement && event.target.classList.contains("wp-overlay")) {
125
+ onClose();
126
+ }
127
+ },
128
+ children
129
+ }
130
+ );
131
+ const root = container ?? getOverlayRoot();
132
+ return root ? createPortal(layer, root) : layer;
133
+ }
134
+
135
+ export { OverlayContainerContext, OverlayLayer, getOverlayRoot, useOverlayLayer };
package/dist/index.js CHANGED
@@ -1,18 +1,21 @@
1
- import { TimePicker } from './chunk-36MXPCJP.js';
2
- export { TimePicker, loadOptionalModule } from './chunk-36MXPCJP.js';
1
+ import { TimePicker } from './chunk-WXOU7QTN.js';
2
+ export { TimePicker, loadOptionalModule } from './chunk-WXOU7QTN.js';
3
+ import { useSduiDispatch, SduiDialog, useSduiCan, SduiDispatchContext, SduiPermissionProvider } from './chunk-QU7YVMFA.js';
4
+ export { SduiDialog, SduiPermissionProvider, useSduiCan, useSduiDispatch } from './chunk-QU7YVMFA.js';
3
5
  import { ImageViewer } from './chunk-THEP3VWY.js';
4
6
  export { ImageViewer } from './chunk-THEP3VWY.js';
5
- import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-U7ZK7WYH.js';
6
- export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-U7ZK7WYH.js';
7
+ import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-BD75U73S.js';
8
+ export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-BD75U73S.js';
7
9
  import { DEV, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, useSduiSandbox, resolveAdapter, assetResolverOf, SduiAdapterContext } from './chunk-DVOPZFQS.js';
8
10
  export { defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-DVOPZFQS.js';
9
- import { HoistedStyle, DateRangePicker, DatePicker, OverlayLayer } from './chunk-XKLUCUVA.js';
10
- export { DatePicker, DateRangePicker, OverlayContainerContext, OverlayLayer, getOverlayRoot, useOverlayLayer } from './chunk-XKLUCUVA.js';
11
- import { EmptyState, Button, Checkbox, SegmentedControl, Spinner, Select, Pagination, Icon, Card, Badge, ProgressBar, Tag, Toast, Textarea, Tabs, Table, Switch, StatCard, Input, IconButton, Field, Alert, warnOnce, Dialog } from './chunk-WIDDHR7L.js';
11
+ import { HoistedStyle, DateRangePicker, DatePicker } from './chunk-EFMKWPZ3.js';
12
+ export { DatePicker, DateRangePicker } from './chunk-EFMKWPZ3.js';
13
+ export { OverlayContainerContext, OverlayLayer, getOverlayRoot, useOverlayLayer } from './chunk-XQPTSEJC.js';
14
+ import { EmptyState, Button, Checkbox, SegmentedControl, Spinner, Select, Pagination, Icon, Card, Badge, ProgressBar, Tag, Toast, Textarea, Tabs, Table, Switch, StatCard, Input, IconButton, Field, Alert, warnOnce } from './chunk-WIDDHR7L.js';
12
15
  export { Alert, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Dialog, EmptyState, Field, Icon, IconButton, Input, Pagination, ProgressBar, Radio, SegmentedControl, Select, SidebarNav, Spinner, StatCard, Switch, Table, Tabs, Tag, Textarea, Toast, Tooltip } from './chunk-WIDDHR7L.js';
13
16
  import { boxed, mergeStyle, containerLayoutStyle, joinClass, columnsClass, typographyStyle, LAYOUT_CSS, childLayoutFrom, CHILD_LAYOUT_PROPS } from './chunk-SAN4IX6N.js';
14
17
  export { CHILD_LAYOUT_PROPS, LAYOUT_CSS, boxed, childLayoutFrom, columnsClass, containerLayoutStyle, joinClass, mergeStyle, typographyStyle } from './chunk-SAN4IX6N.js';
15
- import React11, { createContext, useState, useMemo, useContext, useRef, useEffect, useCallback } from 'react';
18
+ import React10, { createContext, useState, useMemo, useRef, useEffect, useCallback, useContext } from 'react';
16
19
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
17
20
 
18
21
  // src/asset-url.ts
@@ -109,15 +112,7 @@ function resolveAssetsIn(propName, value, resolve, component) {
109
112
  return out ?? record;
110
113
  }
111
114
  }
112
- var SduiDispatchContext = createContext(null);
113
- function useSduiDispatch() {
114
- const dispatch = useContext(SduiDispatchContext);
115
- if (!dispatch) {
116
- throw new Error("useSduiDispatch\uB294 SduiRenderer \uB0B4\uBD80\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
117
- }
118
- return dispatch;
119
- }
120
- var NodeErrorBoundary = class extends React11.Component {
115
+ var NodeErrorBoundary = class extends React10.Component {
121
116
  state = { error: null };
122
117
  static getDerivedStateFromError(error) {
123
118
  return { error };
@@ -157,27 +152,6 @@ var NodeErrorBoundary = class extends React11.Component {
157
152
  return this.props.children;
158
153
  }
159
154
  };
160
- var ALLOW_ALL = () => true;
161
- var DENY_ALL = () => false;
162
- var MISSING = () => {
163
- warnOnce(
164
- "permission:missing",
165
- '[sdui] \uAD8C\uD55C \uD310\uC815(can)\uC774 \uC8FC\uC785\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4 \u2014 <Can>\uC774 \uC804\uBD80 \uD1B5\uACFC\uD569\uB2C8\uB2E4. SduiRenderer\uC5D0 can \uCF5C\uBC31\uC744 \uB118\uAE30\uAC70\uB098, \uC138\uC158\uC774 \uC5C6\uB294 \uBBF8\uB9AC\uBCF4\uAE30\uB77C\uBA74 can="allow-all"\uC744 \uBA85\uC2DC\uD558\uC138\uC694.'
166
- );
167
- return true;
168
- };
169
- var SduiPermissionContext = createContext(null);
170
- function SduiPermissionProvider({ can, children }) {
171
- const value = useMemo(() => {
172
- if (can === "allow-all") return ALLOW_ALL;
173
- if (can === "deny-all") return DENY_ALL;
174
- return typeof can === "function" ? can : null;
175
- }, [can]);
176
- return /* @__PURE__ */ jsx(SduiPermissionContext.Provider, { value, children });
177
- }
178
- function useSduiCan() {
179
- return useContext(SduiPermissionContext) ?? MISSING;
180
- }
181
155
  function Can({ entity, action = "read", scope, fallback = null, children }) {
182
156
  const can = useSduiCan();
183
157
  if (typeof entity !== "string" || entity === "") {
@@ -304,7 +278,7 @@ function KeyValueList({ source, items, className, style }) {
304
278
  return /* @__PURE__ */ jsx("div", { className: joinClass("wp-kv", className), style, children: (items ?? []).map((item, index) => {
305
279
  const raw = item.key ? source?.[item.key] : item.value;
306
280
  const content = raw === null || raw === void 0 || raw === "" ? "\u2014" : raw;
307
- return /* @__PURE__ */ jsxs(React11.Fragment, { children: [
281
+ return /* @__PURE__ */ jsxs(React10.Fragment, { children: [
308
282
  /* @__PURE__ */ jsx("span", { className: "wp-kv__k", children: item.label }),
309
283
  /* @__PURE__ */ jsx("span", { className: joinClass("wp-kv__v", item.mono && "wp-mono"), children: content })
310
284
  ] }, index);
@@ -1365,9 +1339,6 @@ function RemoteSearchResultsImpl({
1365
1339
  }
1366
1340
  var SduiSearchResults = boxed(SduiSearchResultsImpl, "SduiSearchResults");
1367
1341
  var RemoteSearchResults = boxed(RemoteSearchResultsImpl, "RemoteSearchResults");
1368
- function SduiDialog(props) {
1369
- return /* @__PURE__ */ jsx(OverlayLayer, { onClose: props.onClose, children: /* @__PURE__ */ jsx(Dialog, { ...props }) });
1370
- }
1371
1342
  var SduiRuntimeContext = createContext(null);
1372
1343
  function useSduiRuntime() {
1373
1344
  const runtime = useContext(SduiRuntimeContext);
@@ -2668,7 +2639,7 @@ function SduiNodeRenderer({
2668
2639
  return /* @__PURE__ */ jsx(Fragment, { children: rows.map((item, rowIndex) => {
2669
2640
  const rowScope = [...scope, { item, index: rowIndex }];
2670
2641
  const rowKey = isPlainObject4(item) && typeof item.id === "string" ? item.id : rowIndex;
2671
- return /* @__PURE__ */ jsx(React11.Fragment, { children: childList?.map((child, i) => renderChild(child, i, rowScope, engine)) }, rowKey);
2642
+ return /* @__PURE__ */ jsx(React10.Fragment, { children: childList?.map((child, i) => renderChild(child, i, rowScope, engine)) }, rowKey);
2672
2643
  }) });
2673
2644
  }
2674
2645
  if (node.component === "Fragment") {
@@ -2744,11 +2715,11 @@ function SduiNodeRenderer({
2744
2715
  const children = childList?.map((child, i) => renderChild(child, i, scope, engine));
2745
2716
  return /* @__PURE__ */ jsx(Component, { ...props, children });
2746
2717
  }
2747
- var SduiFragmentChainContext = React11.createContext([]);
2718
+ var SduiFragmentChainContext = React10.createContext([]);
2748
2719
  var FRAGMENT_MAX_DEPTH = 4;
2749
2720
  function SduiFragment({ node, scope, engine }) {
2750
2721
  const adapter = useSduiAdapter();
2751
- const chain = React11.useContext(SduiFragmentChainContext);
2722
+ const chain = React10.useContext(SduiFragmentChainContext);
2752
2723
  const raw = isPlainObject4(node.props) ? node.props.id : void 0;
2753
2724
  const id = engine.resolveValue(raw, scope);
2754
2725
  if (typeof id !== "string" || id === "") {
@@ -2803,9 +2774,9 @@ function SduiFragmentBody({
2803
2774
  engine
2804
2775
  }) {
2805
2776
  const spec = useSpec(id);
2806
- const nextChain = React11.useMemo(() => [...chain, id], [chain, id]);
2807
- const bodyScope = React11.useMemo(() => [...scope, { args, callSiteScope: scope }], [scope, args]);
2808
- React11.useEffect(() => {
2777
+ const nextChain = React10.useMemo(() => [...chain, id], [chain, id]);
2778
+ const bodyScope = React10.useMemo(() => [...scope, { args, callSiteScope: scope }], [scope, args]);
2779
+ React10.useEffect(() => {
2809
2780
  if (!DEV || !isPlainObject4(spec) || !Array.isArray(spec.body)) return;
2810
2781
  validateSpec(spec, new Set(Object.keys(engine.registry))).forEach(
2811
2782
  (issue) => console.warn(`[sdui:spec:${id}] ${issue.path} \u2014 ${issue.message}`)
@@ -3296,4 +3267,4 @@ function SduiRenderer({
3296
3267
  );
3297
3268
  }
3298
3269
 
3299
- export { Actions, CALC_OPS, Can, Col, Divider, Grid, KeyValueList, NodeErrorBoundary, PageHead, RemoteSearchResults, ResultTable, Row, SduiDialog, SduiForm, SduiPermissionProvider, SduiRenderer, SduiSearchDataProvider, SduiSearchResults, SearchResults, Section, Show, SortHandle, SortableList, Spacer, Text, cellRenderer, createRegistry, defaultRegistry, imageRenderer, normalizePageSizes, sortableDropIndex, sortableMove, useRemoteSearchPage, useSduiCan, useSduiDispatch, useSduiRuntime, useSearchFetcher, validateSpec };
3270
+ export { Actions, CALC_OPS, Can, Col, Divider, Grid, KeyValueList, NodeErrorBoundary, PageHead, RemoteSearchResults, ResultTable, Row, SduiForm, SduiRenderer, SduiSearchDataProvider, SduiSearchResults, SearchResults, Section, Show, SortHandle, SortableList, Spacer, Text, cellRenderer, createRegistry, defaultRegistry, imageRenderer, normalizePageSizes, sortableDropIndex, sortableMove, useRemoteSearchPage, useSduiRuntime, useSearchFetcher, validateSpec };
package/dist/meta.d.ts CHANGED
@@ -424,6 +424,7 @@ declare const richComponentMeta: {
424
424
  */
425
425
 
426
426
  declare const ApprovalStepperMeta: SduiComponentMeta;
427
+ declare const RankBoardMeta: SduiComponentMeta;
427
428
  declare const AutocompleteFieldMeta: SduiComponentMeta;
428
429
  declare const InlineEditMeta: SduiComponentMeta;
429
430
  declare const JsonFieldMeta: SduiComponentMeta;
@@ -458,6 +459,7 @@ declare const StripMeta: SduiComponentMeta;
458
459
  */
459
460
  declare const widgetComponentMeta: {
460
461
  ApprovalStepper: SduiComponentMeta;
462
+ RankBoard: SduiComponentMeta;
461
463
  AutocompleteField: SduiComponentMeta;
462
464
  ColumnBoard: SduiComponentMeta;
463
465
  DiffView: SduiComponentMeta;
@@ -590,4 +592,4 @@ declare function paletteGroups(catalog?: Record<string, SduiComponentMeta>): Arr
590
592
  items: SduiComponentMeta[];
591
593
  }>;
592
594
 
593
- export { ActionsMeta, AlertMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
595
+ export { ActionsMeta, AlertMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
package/dist/meta.js CHANGED
@@ -3393,6 +3393,29 @@ var ApprovalStepperMeta = {
3393
3393
  },
3394
3394
  resize: { kind: "none" }
3395
3395
  };
3396
+ var RankBoardMeta = {
3397
+ name: "RankBoard",
3398
+ label: "\uC9C1\uC704 \uC11C\uC5F4 \uBCF4\uB4DC",
3399
+ category: "input",
3400
+ icon: "list",
3401
+ description: "\uC9C1\uC704 \uB9C8\uC2A4\uD130\uB97C \uAE09(rank_order) \uD589 \xD7 \uC9C1\uC704 \uCE69\uC758 2\uCC28\uC6D0 \uB4DC\uB798\uADF8 \uBCF4\uB4DC\uB85C \uD3B8\uC9D1\uD55C\uB2E4. \uBAA9\uB85D\xB7\uB4F1\uB85D\xB7\uC218\uC815\xB7\uC0AD\uC81C\xB7\uC21C\uC11C \uC800\uC7A5(PUT {endpoint}/order {ranks})\uC744 \uC704\uC82F\uC774 \uC18C\uC720\uD558\uACE0, \uBCC0\uACBD \uD6C4 invalidate \uC561\uC158\uC73C\uB85C \uB2E4\uB978 \uD654\uBA74\uC758 \uC9C1\uC704 \uC870\uD68C\uB97C \uB3D9\uAE30\uD654\uD55C\uB2E4.",
3402
+ props: [
3403
+ { name: "endpoint", kind: "string", label: "API \uACBD\uB85C", default: "/job-positions", description: "\uC9C1\uC704 \uB9C8\uC2A4\uD130 \uB9AC\uC18C\uC2A4 \uACBD\uB85C \u2014 GET/POST/PATCH/DELETE\uC640 PUT {endpoint}/order \uC804\uBD80 \uC774 \uACBD\uB85C\uB97C \uC4F4\uB2E4.", group: "data", advanced: true },
3404
+ { name: "entity", kind: "string", label: "\uAD8C\uD55C \uC5D4\uD2F0\uD2F0", default: "job_position", description: "\uD504\uB86D \uC0DD\uB7B5 \uC2DC \uB80C\uB354\uB7EC \uAD8C\uD55C \uD310\uC815\uC5D0 \uC4F8 \uC5D4\uD2F0\uD2F0.", group: "behavior", advanced: true },
3405
+ { name: "canCreate", kind: "boolean", label: "\uB4F1\uB85D \uD5C8\uC6A9", bindable: true, description: "\uC0DD\uB7B5\uD558\uBA74 \uB80C\uB354\uB7EC \uAD8C\uD55C \uD310\uC815(entity.create)\uC73C\uB85C \uC2A4\uC2A4\uB85C \uD310\uB2E8\uD55C\uB2E4.", group: "behavior", advanced: true },
3406
+ { name: "canUpdate", kind: "boolean", label: "\uC218\uC815 \uD5C8\uC6A9", bindable: true, description: "\uC0DD\uB7B5\uD558\uBA74 entity.update \uD310\uC815.", group: "behavior", advanced: true },
3407
+ { name: "canDelete", kind: "boolean", label: "\uC0AD\uC81C \uD5C8\uC6A9", bindable: true, description: "\uC0DD\uB7B5\uD558\uBA74 entity.delete \uD310\uC815.", group: "behavior", advanced: true }
3408
+ ],
3409
+ children: { accepts: false },
3410
+ dom: { element: "div" },
3411
+ preset: {
3412
+ component: "RankBoard",
3413
+ // 빈 props 는 저장 왕복에서 사라지므로(편집기 계약) 프리셋은 실제로 채운다.
3414
+ // 경로·엔티티는 도메인이 아니라 설정이라 예시 값을 둔다 — 드롭한 사람이 곧 바꾼다.
3415
+ props: { endpoint: "/job-positions", entity: "job_position" }
3416
+ },
3417
+ resize: { kind: "none" }
3418
+ };
3396
3419
  var AutocompleteFieldMeta = {
3397
3420
  name: "AutocompleteField",
3398
3421
  label: "\uC790\uB3D9\uC644\uC131",
@@ -4811,6 +4834,7 @@ var StripMeta = {
4811
4834
  };
4812
4835
  var widgetComponentMeta = {
4813
4836
  ApprovalStepper: ApprovalStepperMeta,
4837
+ RankBoard: RankBoardMeta,
4814
4838
  AutocompleteField: AutocompleteFieldMeta,
4815
4839
  ColumnBoard: ColumnBoardMeta,
4816
4840
  DiffView: DiffViewMeta,
@@ -4868,4 +4892,4 @@ function paletteGroups(catalog = allComponentMeta) {
4868
4892
  })).filter((group) => group.items.length > 0);
4869
4893
  }
4870
4894
 
4871
- export { ActionsMeta, AlertMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
4895
+ export { ActionsMeta, AlertMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, FieldMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
package/dist/rich.js CHANGED
@@ -1,8 +1,9 @@
1
- import { useOptionalModule, DependencyPlaceholder } from './chunk-36MXPCJP.js';
2
- export { TimePicker } from './chunk-36MXPCJP.js';
1
+ import { useOptionalModule, DependencyPlaceholder } from './chunk-WXOU7QTN.js';
2
+ export { TimePicker } from './chunk-WXOU7QTN.js';
3
3
  import { useSduiAssetResolver } from './chunk-DVOPZFQS.js';
4
- import { HoistedStyle } from './chunk-XKLUCUVA.js';
5
- export { DatePicker, DateRangePicker } from './chunk-XKLUCUVA.js';
4
+ import { HoistedStyle } from './chunk-EFMKWPZ3.js';
5
+ export { DatePicker, DateRangePicker } from './chunk-EFMKWPZ3.js';
6
+ import './chunk-XQPTSEJC.js';
6
7
  import { Spinner, EmptyState } from './chunk-WIDDHR7L.js';
7
8
  import './chunk-SAN4IX6N.js';
8
9
  import { useRef, useCallback, useMemo, useState, useEffect, useLayoutEffect } from 'react';
@@ -1,6 +1,7 @@
1
- export { AutocompleteField, endpointSearchFn, toAutocompleteOptions } from '../chunk-OG62LSFH.js';
2
- import '../chunk-U7ZK7WYH.js';
1
+ export { AutocompleteField, endpointSearchFn, toAutocompleteOptions } from '../chunk-6S5CFNFM.js';
2
+ import '../chunk-BD75U73S.js';
3
3
  import '../chunk-DVOPZFQS.js';
4
- import '../chunk-XKLUCUVA.js';
4
+ import '../chunk-EFMKWPZ3.js';
5
+ import '../chunk-XQPTSEJC.js';
5
6
  import '../chunk-WIDDHR7L.js';
6
7
  import '../chunk-SAN4IX6N.js';
@@ -1,4 +1,5 @@
1
- export { PeriodFilter } from '../chunk-PFUULIZ2.js';
2
- import '../chunk-XKLUCUVA.js';
1
+ export { PeriodFilter } from '../chunk-INWASR2G.js';
2
+ import '../chunk-EFMKWPZ3.js';
3
+ import '../chunk-XQPTSEJC.js';
3
4
  import '../chunk-WIDDHR7L.js';
4
5
  import '../chunk-SAN4IX6N.js';