@ankhorage/zora 28.5.0 → 28.5.2
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/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/dist/features/color/ColorPicker.js +27 -1
- package/dist/features/color/ColorPicker.js.map +1 -1
- package/package.json +4 -4
- package/src/expo57Migration.test.ts +2 -1
- package/src/features/color/ColorPicker.layout.test.tsx +60 -0
- package/src/features/color/ColorPicker.tsx +31 -1
- package/src/webPeerContract.test.ts +17 -0
- package/web-dist/chunks/{Accordion-x4yhr2wm.js → Accordion-23k6n6zk.js} +1 -1
- package/web-dist/chunks/{Accordion-7knb9jk2.js → Accordion-2yat0x6x.js} +2 -1
- package/web-dist/chunks/{Accordion-8jw8g2aq.js → Accordion-554f42yj.js} +21 -2
- package/web-dist/chunks/{Accordion-be2yhfqz.js → Accordion-5z75befg.js} +12 -4
- package/web-dist/chunks/{Accordion-sbdgq8d5.js → Accordion-7nn4r909.js} +15 -8
- package/web-dist/chunks/{Accordion-skdtw2er.js → Accordion-7v6mrp8n.js} +2 -2
- package/web-dist/chunks/{Accordion-d9sd2vs7.js → Accordion-a5fsrv3x.js} +5 -4
- package/web-dist/chunks/{Accordion-kzjq1snp.js → Accordion-d5sz8vaq.js} +1 -1
- package/web-dist/chunks/{Accordion-a4dmyntn.js → Accordion-ktscjwa2.js} +1 -1
- package/web-dist/chunks/{Accordion-9gk4scdz.js → Accordion-sj1n06dw.js} +1 -1
- package/web-dist/components/app-bar/AppBar.js +5 -5
- package/web-dist/components/app-header/AppHeader.js +5 -5
- package/web-dist/components/color-hue-scale/ColorHueScale.js +4 -4
- package/web-dist/components/color-picker/ColorPicker.js +4 -4
- package/web-dist/components/color-tone/ColorTone.js +4 -4
- package/web-dist/components/color-wheel/ColorWheel.js +4 -4
- package/web-dist/components/data-table/DataTable.js +4 -4
- package/web-dist/components/date-picker/DatePicker.js +2 -2
- package/web-dist/components/dialog/Dialog.js +3 -3
- package/web-dist/components/popover/Popover.js +2 -2
- package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
- package/web-dist/components/reader/Reader.js +6 -6
- package/web-dist/components/select/Select.js +3 -3
- package/web-dist/components/time-picker/TimePicker.js +2 -2
- package/web-dist/components/toast/Toast.js +3 -3
- package/web-dist/components/toast-provider/ToastProvider.js +3 -3
- package/web-dist/components/uploader/Uploader.js +3 -3
- package/web-dist/manifest.json +62 -62
- package/web-dist/runtime/ZoraProvider.js +81 -52
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
sortOverlayEntries,
|
|
10
10
|
OverlayStackContext,
|
|
11
11
|
OverlayStackActionsContext,
|
|
12
|
+
OverlayEntryContext,
|
|
12
13
|
createOverlayEntry
|
|
13
|
-
} from "../chunks/Accordion-
|
|
14
|
+
} from "../chunks/Accordion-7nn4r909.js";
|
|
14
15
|
import {
|
|
15
16
|
useFontRuntime,
|
|
16
17
|
zoraDefaultTheme,
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
} from "../chunks/Accordion-9d38cgqj.js";
|
|
25
26
|
import {
|
|
26
27
|
ToastProvider3
|
|
27
|
-
} from "../chunks/Accordion-
|
|
28
|
+
} from "../chunks/Accordion-ktscjwa2.js";
|
|
28
29
|
import"../chunks/Accordion-pdjhezmz.js";
|
|
29
30
|
import"../chunks/Accordion-9b4bsxwe.js";
|
|
30
31
|
import"../chunks/Accordion-eqvdv7tt.js";
|
|
@@ -46,10 +47,9 @@ import {
|
|
|
46
47
|
// node_modules/@ankhorage/surface/src/features/theme/adapters/inbound/ThemeProvider.tsx
|
|
47
48
|
import { useMemo, useState } from "react";
|
|
48
49
|
|
|
49
|
-
// node_modules/@ankhorage/surface/src/internal/overlay/
|
|
50
|
+
// node_modules/@ankhorage/surface/src/internal/overlay/OverlayStackHost.tsx
|
|
50
51
|
var import_react_native = __toESM(require_cjs(), 1);
|
|
51
|
-
import
|
|
52
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
+
import { jsx } from "react/jsx-runtime";
|
|
53
53
|
import { createElement } from "react";
|
|
54
54
|
var boxNonePointerEvents = resolvePointerEvents("box-none");
|
|
55
55
|
var styles = import_react_native.StyleSheet.create({
|
|
@@ -61,56 +61,85 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
61
61
|
top: 0
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
function OverlayStackHost({ overlays }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(import_react_native.View, {
|
|
66
|
+
...boxNonePointerEvents.props,
|
|
67
|
+
style: [boxNonePointerEvents.style, styles.fill],
|
|
68
|
+
children: overlays.map((overlay) => /* @__PURE__ */ createElement(import_react_native.View, {
|
|
69
|
+
...boxNonePointerEvents.props,
|
|
70
|
+
key: overlay.id,
|
|
71
|
+
style: [boxNonePointerEvents.style, styles.fill, overlayZIndex(overlay.zIndex)]
|
|
72
|
+
}, /* @__PURE__ */ jsx(OverlayEntryContext, {
|
|
73
|
+
value: overlay,
|
|
74
|
+
children: overlay.node
|
|
75
|
+
})))
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function overlayZIndex(zIndex) {
|
|
79
|
+
return { zIndex };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// node_modules/@ankhorage/surface/src/internal/overlay/useOverlayStackRuntime.ts
|
|
83
|
+
import React2 from "react";
|
|
84
|
+
function useOverlayStackRuntime() {
|
|
85
|
+
const orderRef = React2.useRef(0);
|
|
86
|
+
const [overlays, setOverlays] = React2.useState([]);
|
|
87
|
+
const overlaysRef = React2.useRef([]);
|
|
88
|
+
React2.useEffect(() => {
|
|
89
|
+
overlaysRef.current = overlays;
|
|
90
|
+
}, [overlays]);
|
|
91
|
+
const setOverlay = React2.useCallback((id, descriptor) => {
|
|
68
92
|
setOverlays((current) => {
|
|
69
93
|
const existing = current.find((entry) => entry.id === id);
|
|
70
94
|
const nextEntry = createOverlayEntry(id, existing?.order ?? orderRef.current++, descriptor);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return sortOverlayEntries(current.map((entry) => entry.id === id ? nextEntry : entry));
|
|
95
|
+
const next = !existing ? sortOverlayEntries([...current, nextEntry]) : sortOverlayEntries(current.map((entry) => entry.id === id ? nextEntry : entry));
|
|
96
|
+
overlaysRef.current = next;
|
|
97
|
+
return next;
|
|
75
98
|
});
|
|
76
99
|
}, []);
|
|
77
|
-
const removeOverlay =
|
|
78
|
-
setOverlays((current) =>
|
|
100
|
+
const removeOverlay = React2.useCallback((id) => {
|
|
101
|
+
setOverlays((current) => {
|
|
102
|
+
const next = current.filter((entry) => !isOverlayDescendantOf(entry, id, current));
|
|
103
|
+
overlaysRef.current = next;
|
|
104
|
+
return next;
|
|
105
|
+
});
|
|
106
|
+
}, []);
|
|
107
|
+
const dismissTopmost = React2.useCallback(() => {
|
|
108
|
+
const topmost = overlaysRef.current.at(-1);
|
|
109
|
+
topmost?.onDismiss?.();
|
|
79
110
|
}, []);
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return
|
|
111
|
+
const isTopmost = React2.useCallback((id) => overlaysRef.current.at(-1)?.id === id, []);
|
|
112
|
+
const actions = React2.useMemo(() => ({ dismissTopmost, isTopmost, removeOverlay, setOverlay }), [dismissTopmost, isTopmost, removeOverlay, setOverlay]);
|
|
113
|
+
const value = React2.useMemo(() => ({ dismissTopmost, isTopmost, overlays, removeOverlay, setOverlay }), [dismissTopmost, isTopmost, overlays, removeOverlay, setOverlay]);
|
|
114
|
+
return { actions, value };
|
|
115
|
+
}
|
|
116
|
+
function isOverlayDescendantOf(entry, removedId, overlays) {
|
|
117
|
+
if (entry.id === removedId)
|
|
118
|
+
return true;
|
|
119
|
+
const parent = entry.parentId === undefined ? undefined : overlays.find((item) => item.id === entry.parentId);
|
|
120
|
+
return parent === undefined ? false : isOverlayDescendantOf(parent, removedId, overlays);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// node_modules/@ankhorage/surface/src/internal/overlay/OverlayProvider.tsx
|
|
124
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
125
|
+
function OverlayProvider({ children }) {
|
|
126
|
+
const { actions, value } = useOverlayStackRuntime();
|
|
127
|
+
return /* @__PURE__ */ jsx2(OverlayStackActionsContext, {
|
|
90
128
|
value: actions,
|
|
91
129
|
children: /* @__PURE__ */ jsxs(OverlayStackContext, {
|
|
92
130
|
value,
|
|
93
131
|
children: [
|
|
94
132
|
children,
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
97
|
-
style: [boxNonePointerEvents.style, styles.fill],
|
|
98
|
-
children: overlays.map((overlay) => /* @__PURE__ */ createElement(import_react_native.View, {
|
|
99
|
-
...boxNonePointerEvents.props,
|
|
100
|
-
key: overlay.id,
|
|
101
|
-
style: [boxNonePointerEvents.style, styles.fill, overlayZIndex(overlay.zIndex)]
|
|
102
|
-
}, overlay.node))
|
|
133
|
+
/* @__PURE__ */ jsx2(OverlayStackHost, {
|
|
134
|
+
overlays: value.overlays
|
|
103
135
|
})
|
|
104
136
|
]
|
|
105
137
|
})
|
|
106
138
|
});
|
|
107
139
|
}
|
|
108
|
-
function overlayZIndex(zIndex) {
|
|
109
|
-
return { zIndex };
|
|
110
|
-
}
|
|
111
140
|
|
|
112
141
|
// node_modules/@ankhorage/surface/src/features/theme/adapters/inbound/ThemeProvider.tsx
|
|
113
|
-
import { jsx as
|
|
142
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
114
143
|
function ThemeProvider({
|
|
115
144
|
children,
|
|
116
145
|
initialConfig,
|
|
@@ -128,10 +157,10 @@ function ThemeProvider({
|
|
|
128
157
|
setThemeConfig: (nextConfig) => setConfig((previous) => deepMerge(previous, nextConfig)),
|
|
129
158
|
setMode
|
|
130
159
|
}), [mode, theme]);
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
children: /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ jsx3(ResponsiveProvider, {
|
|
161
|
+
children: /* @__PURE__ */ jsx3(ThemeRuntimeContext, {
|
|
133
162
|
value,
|
|
134
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ jsx3(OverlayProvider, {
|
|
135
164
|
children
|
|
136
165
|
})
|
|
137
166
|
})
|
|
@@ -139,7 +168,7 @@ function ThemeProvider({
|
|
|
139
168
|
}
|
|
140
169
|
|
|
141
170
|
// src/features/theme/adapters/inbound/ZoraProvider.tsx
|
|
142
|
-
import
|
|
171
|
+
import React3 from "react";
|
|
143
172
|
|
|
144
173
|
// src/features/theme/application/use-cases/createZoraThemeConfig.ts
|
|
145
174
|
function createZoraThemeConfig(theme = zoraDefaultTheme) {
|
|
@@ -159,18 +188,18 @@ function createZoraThemeConfig(theme = zoraDefaultTheme) {
|
|
|
159
188
|
}
|
|
160
189
|
|
|
161
190
|
// src/features/theme/composition/ZoraRuntimeCapabilities.web.tsx
|
|
162
|
-
import { jsx as
|
|
191
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
163
192
|
function ZoraRuntimeCapabilities({ children, toast }) {
|
|
164
193
|
if (!toast)
|
|
165
194
|
return children;
|
|
166
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ jsx4(ToastProvider3, {
|
|
167
196
|
...toast === true ? {} : toast,
|
|
168
197
|
children
|
|
169
198
|
});
|
|
170
199
|
}
|
|
171
200
|
|
|
172
201
|
// src/features/theme/adapters/inbound/ZoraProvider.tsx
|
|
173
|
-
import { jsx as
|
|
202
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
174
203
|
function ZoraProvider({
|
|
175
204
|
bottomSheet = false,
|
|
176
205
|
children,
|
|
@@ -180,17 +209,17 @@ function ZoraProvider({
|
|
|
180
209
|
mode,
|
|
181
210
|
toast = false
|
|
182
211
|
}) {
|
|
183
|
-
const resolvedConfig =
|
|
184
|
-
const runtimeValue =
|
|
185
|
-
return /* @__PURE__ */
|
|
212
|
+
const resolvedConfig = React3.useMemo(() => themeConfig ?? createZoraThemeConfig(theme), [theme, themeConfig]);
|
|
213
|
+
const runtimeValue = React3.useMemo(() => ({ themeId: resolvedConfig.id }), [resolvedConfig.id]);
|
|
214
|
+
return /* @__PURE__ */ jsx5(ZoraThemeRuntimeContext, {
|
|
186
215
|
value: runtimeValue,
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
-
children: /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ jsx5(ResponsiveProvider, {
|
|
217
|
+
children: /* @__PURE__ */ jsx5(ThemeProvider, {
|
|
189
218
|
initialConfig: resolvedConfig,
|
|
190
219
|
initialMode: mode ?? initialMode,
|
|
191
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ jsx5(ZoraProviderMode, {
|
|
192
221
|
mode,
|
|
193
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ jsx5(ZoraRuntimeCapabilities, {
|
|
194
223
|
bottomSheet,
|
|
195
224
|
toast,
|
|
196
225
|
children
|
|
@@ -202,7 +231,7 @@ function ZoraProvider({
|
|
|
202
231
|
}
|
|
203
232
|
function ZoraProviderMode({ children, mode }) {
|
|
204
233
|
const runtime = useTheme();
|
|
205
|
-
|
|
234
|
+
React3.useEffect(() => {
|
|
206
235
|
if (mode !== undefined && runtime.mode !== mode)
|
|
207
236
|
runtime.setMode(mode);
|
|
208
237
|
}, [mode, runtime]);
|