@ankhorage/zora 27.1.13 → 27.2.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/CHANGELOG.md +6 -0
- package/README.md +5 -3
- package/dist/authoring.browser.d.ts +8 -0
- package/dist/authoring.browser.d.ts.map +1 -0
- package/dist/authoring.browser.js +6 -0
- package/dist/authoring.browser.js.map +1 -0
- package/dist/authoring.d.ts +2 -0
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +1 -0
- package/dist/authoring.js.map +1 -1
- package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
- package/dist/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.d.ts.map +1 -1
- package/dist/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.js +2 -3
- package/dist/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.js.map +1 -1
- package/dist/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.d.ts.map +1 -1
- package/dist/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.js +2 -3
- package/dist/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.js.map +1 -1
- package/dist/features/registry/adapters/inbound/ThemeEditorAdapter.d.ts.map +1 -1
- package/dist/features/registry/adapters/inbound/ThemeEditorAdapter.js +5 -5
- package/dist/features/registry/adapters/inbound/ThemeEditorAdapter.js.map +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.js +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.js.map +1 -1
- package/dist/features/typography/utils/resolveHeadingThemeRecipe.d.ts +1 -1
- package/dist/features/typography/utils/resolveTextThemeRecipe.d.ts +1 -1
- package/dist/features/typography/utils/resolveTypographyThemeRecipeFields.d.ts +1 -1
- package/package.json +5 -4
- package/src/authoring.browser.ts +36 -0
- package/src/authoring.ts +22 -0
- package/src/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.tsx +2 -3
- package/src/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.tsx +2 -3
- package/src/features/registry/adapters/inbound/ThemeEditorAdapter.tsx +5 -5
- package/src/features/registry/adapters/inbound/authoringAdapters.test.tsx +9 -3
- package/src/features/selection/adapters/inbound/SelectableItem.tsx +1 -1
- package/src/packedWebConsumerAcceptance.test.ts +24 -0
- package/src/webPackageExports.test.ts +18 -0
- package/web-dist/authoring/index.d.ts +8 -0
- package/web-dist/authoring/index.js +24141 -0
- package/web-dist/chunks/{Accordion-rwk4marz.js → Accordion-5dava2tw.js} +2 -2
- package/web-dist/chunks/{Accordion-dska91jj.js → Accordion-5fnvak2f.js} +4 -4
- package/web-dist/chunks/{Accordion-f2ce5m3x.js → Accordion-7stdyzb2.js} +2 -2
- package/web-dist/chunks/{Accordion-109vh7aq.js → Accordion-dzm870qy.js} +1 -1
- package/web-dist/chunks/{Accordion-v79xc8mb.js → Accordion-ebcg2kyw.js} +0 -1
- package/web-dist/chunks/{Accordion-z11jhrng.js → Accordion-fav5ysdt.js} +2 -2
- package/web-dist/chunks/{Accordion-pv1432kr.js → Accordion-gze50cz3.js} +1 -1
- package/web-dist/chunks/{Accordion-aqqx878d.js → Accordion-hzjpf45g.js} +1 -1
- package/web-dist/chunks/{Accordion-k3mcnzzz.js → Accordion-k8te4bkw.js} +1 -1
- package/web-dist/chunks/{Accordion-55axaf49.js → Accordion-mx44fvc6.js} +1 -1
- package/web-dist/chunks/{Accordion-2gx0rh1s.js → Accordion-n5ph4b52.js} +3 -3
- package/web-dist/chunks/{Accordion-bn0e6xt0.js → Accordion-ny2p6mkq.js} +2 -2
- package/web-dist/chunks/{Accordion-y0kg8p9s.js → Accordion-q5f4tv3t.js} +1 -1
- package/web-dist/chunks/{Accordion-vmbaw3e9.js → Accordion-qgw1xvqt.js} +1 -1
- package/web-dist/chunks/{Accordion-xwg44t8y.js → Accordion-s5xn38jm.js} +1 -1
- package/web-dist/chunks/{Accordion-ecknv9v4.js → Accordion-smgdhcxa.js} +2 -2
- package/web-dist/chunks/{Accordion-2d49mqp7.js → Accordion-w2tyyyf0.js} +1 -1
- package/web-dist/chunks/{Accordion-9j3x1ccv.js → Accordion-y47gqp58.js} +2 -2
- package/web-dist/chunks/{Accordion-xyx98xnk.js → Accordion-zm4hxqya.js} +1 -1
- package/web-dist/components/accordion/Accordion.js +3 -4
- package/web-dist/components/accordion-item/AccordionItem.js +3 -4
- package/web-dist/components/app-bar/AppBar.js +5 -6
- package/web-dist/components/app-header/AppHeader.js +5 -6
- package/web-dist/components/auth-screen/AuthScreen.js +5 -6
- package/web-dist/components/avatar/Avatar.js +3 -4
- package/web-dist/components/avatar-group/AvatarGroup.js +3 -4
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +7 -8
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +3 -4
- package/web-dist/components/button/Button.js +2 -3
- package/web-dist/components/button-group/ButtonGroup.js +2 -3
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +7 -8
- package/web-dist/components/card/Card.js +6 -7
- package/web-dist/components/chat-list-item/ChatListItem.js +4 -5
- package/web-dist/components/checkbox/Checkbox.js +0 -1
- package/web-dist/components/checkbox-group/CheckboxGroup.js +0 -1
- package/web-dist/components/chip/Chip.js +3 -4
- package/web-dist/components/chip-group/ChipGroup.js +3 -4
- package/web-dist/components/collection-editor/CollectionEditor.js +6 -7
- package/web-dist/components/content-rail/ContentRail.js +2 -3
- package/web-dist/components/data-table/DataTable.js +9 -10
- package/web-dist/components/date-picker/DatePicker.js +2 -3
- package/web-dist/components/dialog/Dialog.js +0 -1
- package/web-dist/components/empty-state/EmptyState.js +7 -8
- package/web-dist/components/explorer/Explorer.js +4 -5
- package/web-dist/components/field/Field.js +0 -1
- package/web-dist/components/file-explorer/FileExplorer.js +4 -5
- package/web-dist/components/flat-list/FlatList.js +0 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +5 -6
- package/web-dist/components/form/Form.js +3 -4
- package/web-dist/components/form-actions/FormActions.js +3 -4
- package/web-dist/components/form-error/FormError.js +3 -4
- package/web-dist/components/heading/Heading.js +0 -1
- package/web-dist/components/hero/Hero.js +6 -7
- package/web-dist/components/icon/Icon.js +2 -3
- package/web-dist/components/icon-button/IconButton.js +2 -3
- package/web-dist/components/image/Image.js +3 -4
- package/web-dist/components/list/List.js +0 -1
- package/web-dist/components/list-item/ListItem.js +0 -1
- package/web-dist/components/list-section/ListSection.js +0 -1
- package/web-dist/components/matrix-grid/MatrixGrid.js +2 -1
- package/web-dist/components/media-card/MediaCard.js +6 -7
- package/web-dist/components/media-explorer/MediaExplorer.js +4 -5
- package/web-dist/components/message-bubble/MessageBubble.js +4 -5
- package/web-dist/components/metric-card/MetricCard.js +6 -7
- package/web-dist/components/missing-element/MissingElement.js +0 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +5 -6
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +5 -6
- package/web-dist/components/otp-form/OtpForm.js +5 -6
- package/web-dist/components/pagination/Pagination.js +2 -3
- package/web-dist/components/palette-item/PaletteItem.js +6 -7
- package/web-dist/components/popover-menu/PopoverMenu.js +3 -4
- package/web-dist/components/post-card/PostCard.js +6 -7
- package/web-dist/components/product-card/ProductCard.js +6 -7
- package/web-dist/components/progress/Progress.js +0 -1
- package/web-dist/components/progress-ring/ProgressRing.js +0 -1
- package/web-dist/components/radio/Radio.js +3 -4
- package/web-dist/components/radio-group/RadioGroup.js +3 -4
- package/web-dist/components/rating/Rating.js +2 -3
- package/web-dist/components/reader/Reader.js +6 -7
- package/web-dist/components/scan-overlay/ScanOverlay.js +7 -8
- package/web-dist/components/screen-section/ScreenSection.js +0 -1
- package/web-dist/components/search-input/SearchInput.js +3 -4
- package/web-dist/components/section-header/SectionHeader.js +0 -1
- package/web-dist/components/section-list/SectionList.js +0 -1
- package/web-dist/components/select/Select.js +2 -3
- package/web-dist/components/selectable-item/SelectableItem.js +2 -1
- package/web-dist/components/selection-provider/SelectionProvider.js +2 -1
- package/web-dist/components/sign-in-form/SignInForm.js +5 -6
- package/web-dist/components/sign-up-form/SignUpForm.js +5 -6
- package/web-dist/components/skeleton/Skeleton.js +7 -8
- package/web-dist/components/skeleton-card/SkeletonCard.js +7 -8
- package/web-dist/components/skeleton-list/SkeletonList.js +7 -8
- package/web-dist/components/skeleton-text/SkeletonText.js +7 -8
- package/web-dist/components/text/Text.js +0 -1
- package/web-dist/components/text-input/TextInput.js +3 -4
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +2 -3
- package/web-dist/components/time-picker/TimePicker.js +2 -3
- package/web-dist/components/timeline/Timeline.js +2 -3
- package/web-dist/components/toolbar/Toolbar.js +6 -7
- package/web-dist/components/tree-item/TreeItem.js +4 -5
- package/web-dist/components/uploader/Uploader.js +6 -7
- package/web-dist/manifest.json +297 -294
- package/web-dist/chunks/{Accordion-3p43xhk7.js → Accordion-ysz1t6jz.js} +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD013 MD033 -->
|
|
2
2
|
<!-- This file is generated by Paradox. Do not edit manually. -->
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
# ZORA
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Provides opinionated React Native and React Native Web UI components, theme primitives, registries, and reader surfaces built on @ankhorage/surface.
|
|
9
|
+
|
|
10
|
+
Give independently released applications a reusable, cross-platform presentation layer with explicit public entrypoints for components, themes, registries, readers, and authoring controls.
|
|
9
11
|
|
|
10
12
|
## Usage
|
|
11
13
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';
|
|
2
|
+
export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';
|
|
3
|
+
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
|
+
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
|
+
export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps, AuthoringPropertyControlState, AuthoringPropertyInspectorAdapterProps, AuthoringSelectionAdapterProps, AuthoringSelectionItemState, ThemeEditorAdapterProps, ThemeRecipeFieldControlState, } from './types/authoring-adapters';
|
|
6
|
+
export type { ButtonProps, CardProps, FieldProps, PressableProps, TextInputProps, TextProps, ThemeProviderProps, ThemeRuntime, ViewProps, } from '@ankhorage/surface/authoring-controls';
|
|
7
|
+
export { Button, Card, Field, Pressable, Text, TextInput, ThemeProvider, useTheme, View, } from '@ankhorage/surface/authoring-controls';
|
|
8
|
+
//# sourceMappingURL=authoring.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring.browser.d.ts","sourceRoot":"","sources":["../src/authoring.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,GACL,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';
|
|
2
|
+
export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';
|
|
3
|
+
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
|
+
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
|
+
export { Button, Card, Field, Pressable, Text, TextInput, ThemeProvider, useTheme, View, } from '@ankhorage/surface/authoring-controls';
|
|
6
|
+
//# sourceMappingURL=authoring.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring.browser.js","sourceRoot":"","sources":["../src/authoring.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAsB7F,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,GACL,MAAM,uCAAuC,CAAC","sourcesContent":["export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';\nexport { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';\nexport { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';\nexport { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';\nexport type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './types/authoring-adapters';\nexport type {\n ButtonProps,\n CardProps,\n FieldProps,\n PressableProps,\n TextInputProps,\n TextProps,\n ThemeProviderProps,\n ThemeRuntime,\n ViewProps,\n} from '@ankhorage/surface/authoring-controls';\nexport {\n Button,\n Card,\n Field,\n Pressable,\n Text,\n TextInput,\n ThemeProvider,\n useTheme,\n View,\n} from '@ankhorage/surface/authoring-controls';\n"]}
|
package/dist/authoring.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/
|
|
|
3
3
|
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
4
|
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
5
|
export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps, AuthoringPropertyControlState, AuthoringPropertyInspectorAdapterProps, AuthoringSelectionAdapterProps, AuthoringSelectionItemState, ThemeEditorAdapterProps, ThemeRecipeFieldControlState, } from './types/authoring-adapters';
|
|
6
|
+
export type { ButtonProps, CardProps, FieldProps, PressableProps, TextInputProps, TextProps, ThemeProviderProps, ThemeRuntime, ViewProps, } from '@ankhorage/surface/authoring-controls';
|
|
7
|
+
export { Button, Card, Field, Pressable, Text, TextInput, ThemeProvider, useTheme, View, } from '@ankhorage/surface/authoring-controls';
|
|
6
8
|
//# sourceMappingURL=authoring.d.ts.map
|
package/dist/authoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,GACL,MAAM,uCAAuC,CAAC"}
|
package/dist/authoring.js
CHANGED
|
@@ -2,4 +2,5 @@ export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbo
|
|
|
2
2
|
export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';
|
|
3
3
|
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
4
|
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
|
+
export { Button, Card, Field, Pressable, Text, TextInput, ThemeProvider, useTheme, View, } from '@ankhorage/surface/authoring-controls';
|
|
5
6
|
//# sourceMappingURL=authoring.js.map
|
package/dist/authoring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC","sourcesContent":["export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';\nexport { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';\nexport { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';\nexport { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';\nexport type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './types/authoring-adapters';\n"]}
|
|
1
|
+
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,iCAAiC,EAAE,MAAM,wEAAwE,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAsB7F,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,GACL,MAAM,uCAAuC,CAAC","sourcesContent":["export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';\nexport { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';\nexport { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';\nexport { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';\nexport type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './types/authoring-adapters';\nexport type {\n ButtonProps,\n CardProps,\n FieldProps,\n PressableProps,\n TextInputProps,\n TextProps,\n ThemeProviderProps,\n ThemeRuntime,\n ViewProps,\n} from '@ankhorage/surface/authoring-controls';\nexport {\n Button,\n Card,\n Field,\n Pressable,\n Text,\n TextInput,\n ThemeProvider,\n useTheme,\n View,\n} from '@ankhorage/surface/authoring-controls';\n"]}
|
|
@@ -7,5 +7,5 @@ export declare function resolveButtonThemeRecipe(input: {
|
|
|
7
7
|
readonly variant?: ZoraButtonVariant;
|
|
8
8
|
readonly size?: ZoraControlSize;
|
|
9
9
|
readonly themeFields: Readonly<Record<string, ThemeRecipeOverrideValue>>;
|
|
10
|
-
}): Pick<import("@ankhorage/surface").ButtonProps, "color" | "
|
|
10
|
+
}): Pick<import("@ankhorage/surface").ButtonProps, "color" | "variant" | "size">;
|
|
11
11
|
//# sourceMappingURL=resolveButtonThemeRecipe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthoringBindingEditorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthoringBindingEditorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE/F,oHAAoH;AACpH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,QAAQ,EAAE,EAC7D,IAAI,EACJ,SAAS,EACT,UAAU,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,QAAgB,GACjB,EAAE,kCAAkC,CAAC,KAAK,EAAE,QAAQ,CAAC,4BAoCrD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { Field, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Field } from '../../../form/public';
|
|
3
|
-
import { View } from '../../../layout/public';
|
|
4
3
|
/*** Presents canonical bindable properties while leaving binding representation and mutation ownership external. */
|
|
5
4
|
export function AuthoringBindingEditorAdapter({ node, component, getBinding, onBindingChange, renderBinding, isBindingDisabled, isBindingRequired, disabled = false, }) {
|
|
6
5
|
if (node === null || component === null)
|
|
@@ -12,7 +11,7 @@ export function AuthoringBindingEditorAdapter({ node, component, getBinding, onB
|
|
|
12
11
|
{Object.entries(bindings).map(([name, meta]) => {
|
|
13
12
|
const controlDisabled = disabled || isBindingDisabled?.(node, name) === true;
|
|
14
13
|
const required = isBindingRequired?.(node, name) === true;
|
|
15
|
-
return (<Field key={name}
|
|
14
|
+
return (<Field key={name} helperText={meta.description} disabled={controlDisabled} label={meta.label ?? name} required={required}>
|
|
16
15
|
{renderBinding({
|
|
17
16
|
node,
|
|
18
17
|
component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthoringBindingEditorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AuthoringBindingEditorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringBindingEditorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,oHAAoH;AACpH,MAAM,UAAU,6BAA6B,CAAkB,EAC7D,IAAI,EACJ,SAAS,EACT,UAAU,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,GAAG,KAAK,GACoC;IACpD,IAAI,IAAI,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC;IAC3C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAExC,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACX;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;YAC7C,MAAM,eAAe,GAAG,QAAQ,IAAI,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YAC7E,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YAC1D,OAAO,CACL,CAAC,KAAK,CACJ,GAAG,CAAC,CAAC,IAAI,CAAC,CACV,UAAU,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAC7B,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAC1B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;YAAA,CAAC,aAAa,CAAC;oBACb,IAAI;oBACJ,SAAS;oBACT,IAAI;oBACJ,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;oBACzB,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC;oBAC/B,QAAQ,EAAE,eAAe;oBACzB,QAAQ;oBACR,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;wBACpB,IAAI,CAAC,eAAe;4BAAE,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;oBAC/D,CAAC;iBACF,CAAC,CACJ;UAAA,EAAE,KAAK,CAAC,CACT,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Field, View } from '@ankhorage/surface/authoring-controls';\nimport React from 'react';\n\nimport type { AuthoringBindingEditorAdapterProps } from '../../../../types/authoring-adapters';\n\n/*** Presents canonical bindable properties while leaving binding representation and mutation ownership external. */\nexport function AuthoringBindingEditorAdapter<TNode, TBinding>({\n node,\n component,\n getBinding,\n onBindingChange,\n renderBinding,\n isBindingDisabled,\n isBindingRequired,\n disabled = false,\n}: AuthoringBindingEditorAdapterProps<TNode, TBinding>) {\n if (node === null || component === null) return null;\n const bindings = component.bindings?.props;\n if (bindings === undefined) return null;\n\n return (\n <View gap=\"m\">\n {Object.entries(bindings).map(([name, meta]) => {\n const controlDisabled = disabled || isBindingDisabled?.(node, name) === true;\n const required = isBindingRequired?.(node, name) === true;\n return (\n <Field\n key={name}\n helperText={meta.description}\n disabled={controlDisabled}\n label={meta.label ?? name}\n required={required}\n >\n {renderBinding({\n node,\n component,\n name,\n label: meta.label ?? name,\n description: meta.description,\n binding: getBinding(node, name),\n disabled: controlDisabled,\n required,\n onChange: (binding) => {\n if (!controlDisabled) onBindingChange?.(node, name, binding);\n },\n })}\n </Field>\n );\n })}\n </View>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthoringPropertyInspectorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthoringPropertyInspectorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAEnG,2GAA2G;AAC3G,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,EACvD,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,QAAgB,GACjB,EAAE,sCAAsC,CAAC,KAAK,CAAC,4BAiC/C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { Field, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Field } from '../../../form/public';
|
|
3
|
-
import { View } from '../../../layout/public';
|
|
4
3
|
/*** Presents canonical component properties while keeping node storage and mutations with the consumer. */
|
|
5
4
|
export function AuthoringPropertyInspectorAdapter({ node, component, getPropertyValue, onPropertyChange, renderProperty, isPropertyDisabled, isPropertyRequired, disabled = false, }) {
|
|
6
5
|
if (node === null || component === null)
|
|
@@ -9,7 +8,7 @@ export function AuthoringPropertyInspectorAdapter({ node, component, getProperty
|
|
|
9
8
|
{Object.entries(component.props).map(([name, schema]) => {
|
|
10
9
|
const controlDisabled = disabled || isPropertyDisabled?.(node, name, schema) === true;
|
|
11
10
|
const required = isPropertyRequired?.(node, name, schema) === true;
|
|
12
|
-
return (<Field key={name}
|
|
11
|
+
return (<Field key={name} helperText={schema.label === undefined ? undefined : schema.category} disabled={controlDisabled} label={schema.label ?? name} required={required}>
|
|
13
12
|
{renderProperty({
|
|
14
13
|
node,
|
|
15
14
|
component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthoringPropertyInspectorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AuthoringPropertyInspectorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,2GAA2G;AAC3G,MAAM,UAAU,iCAAiC,CAAQ,EACvD,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,GAAG,KAAK,GAC8B;IAC9C,IAAI,IAAI,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAErD,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACX;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;YACtD,MAAM,eAAe,GAAG,QAAQ,IAAI,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;YACtF,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;YACnE,OAAO,CACL,CAAC,KAAK,CACJ,GAAG,CAAC,CAAC,IAAI,CAAC,CACV,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CACrE,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,CAC5B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;YAAA,CAAC,cAAc,CAAC;oBACd,IAAI;oBACJ,SAAS;oBACT,IAAI;oBACJ,MAAM;oBACN,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC;oBACnC,QAAQ,EAAE,eAAe;oBACzB,QAAQ;oBACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,IAAI,CAAC,eAAe;4BAAE,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;oBAC9D,CAAC;iBACF,CAAC,CACJ;UAAA,EAAE,KAAK,CAAC,CACT,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Field, View } from '@ankhorage/surface/authoring-controls';\nimport React from 'react';\n\nimport type { AuthoringPropertyInspectorAdapterProps } from '../../../../types/authoring-adapters';\n\n/*** Presents canonical component properties while keeping node storage and mutations with the consumer. */\nexport function AuthoringPropertyInspectorAdapter<TNode>({\n node,\n component,\n getPropertyValue,\n onPropertyChange,\n renderProperty,\n isPropertyDisabled,\n isPropertyRequired,\n disabled = false,\n}: AuthoringPropertyInspectorAdapterProps<TNode>) {\n if (node === null || component === null) return null;\n\n return (\n <View gap=\"m\">\n {Object.entries(component.props).map(([name, schema]) => {\n const controlDisabled = disabled || isPropertyDisabled?.(node, name, schema) === true;\n const required = isPropertyRequired?.(node, name, schema) === true;\n return (\n <Field\n key={name}\n helperText={schema.label === undefined ? undefined : schema.category}\n disabled={controlDisabled}\n label={schema.label ?? name}\n required={required}\n >\n {renderProperty({\n node,\n component,\n name,\n schema,\n value: getPropertyValue(node, name),\n disabled: controlDisabled,\n required,\n onChange: (value) => {\n if (!controlDisabled) onPropertyChange?.(node, name, value);\n },\n })}\n </Field>\n );\n })}\n </View>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeEditorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/ThemeEditorAdapter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeEditorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/ThemeEditorAdapter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAGpF,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,EACzC,KAAK,EACL,OAAgC,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,eAAe,EACf,QAAgB,GACjB,EAAE,uBAAuB,CAAC,MAAM,CAAC,4BA4CjC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { Card, Field, Text, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { Card } from '../../../card/public';
|
|
3
|
-
import { Field } from '../../../form/public';
|
|
4
|
-
import { View } from '../../../layout/public';
|
|
5
3
|
import { ZORA_THEME_RECIPE_META } from '../../themeRecipeMeta';
|
|
6
4
|
/*** Presents ZORA recipe fields without taking ownership of a consumer's theme document. */
|
|
7
5
|
export function ThemeEditorAdapter({ theme, recipes = ZORA_THEME_RECIPE_META, getRecipeFieldValue, onRecipeFieldChange, renderField, isFieldDisabled, isFieldRequired, disabled = false, }) {
|
|
8
6
|
if (theme === null)
|
|
9
7
|
return null;
|
|
10
8
|
return (<View gap="m">
|
|
11
|
-
{Object.entries(recipes).map(([recipeName, recipe]) => (<Card key={recipeName}
|
|
9
|
+
{Object.entries(recipes).map(([recipeName, recipe]) => (<Card key={recipeName}>
|
|
12
10
|
<View gap="m">
|
|
11
|
+
<Text>{recipe.name}</Text>
|
|
12
|
+
{recipe.description === undefined ? null : <Text>{recipe.description}</Text>}
|
|
13
13
|
{Object.entries(recipe.fields).map(([fieldName, field]) => {
|
|
14
14
|
const controlDisabled = disabled || isFieldDisabled?.(theme, recipeName, fieldName) === true;
|
|
15
15
|
const required = isFieldRequired?.(theme, recipeName, fieldName) === true;
|
|
16
|
-
return (<Field key={fieldName}
|
|
16
|
+
return (<Field key={fieldName} helperText={field.description} disabled={controlDisabled} label={field.label} required={required}>
|
|
17
17
|
{renderField({
|
|
18
18
|
theme,
|
|
19
19
|
recipeName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeEditorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/ThemeEditorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeEditorAdapter.js","sourceRoot":"","sources":["../../../../../src/features/registry/adapters/inbound/ThemeEditorAdapter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAS,EACzC,KAAK,EACL,OAAO,GAAG,sBAAsB,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,eAAe,EACf,QAAQ,GAAG,KAAK,GACgB;IAChC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACX;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CACrD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CACpB;UAAA,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACX;YAAA,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CACzB;YAAA,CAAC,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CAC5E;YAAA,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;gBACxD,MAAM,eAAe,GACnB,QAAQ,IAAI,eAAe,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;gBACvE,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;gBAC1E,OAAO,CACL,CAAC,KAAK,CACJ,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,UAAU,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC9B,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;kBAAA,CAAC,WAAW,CAAC;wBACX,KAAK;wBACL,UAAU;wBACV,SAAS;wBACT,KAAK;wBACL,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC;wBACxD,QAAQ,EAAE,eAAe;wBACzB,QAAQ;wBACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;4BAClB,IAAI,CAAC,eAAe,EAAE,CAAC;gCACrB,mBAAmB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;4BAC7D,CAAC;wBACH,CAAC;qBACF,CAAC,CACJ;gBAAA,EAAE,KAAK,CAAC,CACT,CAAC;YACJ,CAAC,CAAC,CACJ;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Card, Field, Text, View } from '@ankhorage/surface/authoring-controls';\nimport React from 'react';\n\nimport type { ThemeEditorAdapterProps } from '../../../../types/authoring-adapters';\nimport { ZORA_THEME_RECIPE_META } from '../../themeRecipeMeta';\n\n/*** Presents ZORA recipe fields without taking ownership of a consumer's theme document. */\nexport function ThemeEditorAdapter<TTheme>({\n theme,\n recipes = ZORA_THEME_RECIPE_META,\n getRecipeFieldValue,\n onRecipeFieldChange,\n renderField,\n isFieldDisabled,\n isFieldRequired,\n disabled = false,\n}: ThemeEditorAdapterProps<TTheme>) {\n if (theme === null) return null;\n\n return (\n <View gap=\"m\">\n {Object.entries(recipes).map(([recipeName, recipe]) => (\n <Card key={recipeName}>\n <View gap=\"m\">\n <Text>{recipe.name}</Text>\n {recipe.description === undefined ? null : <Text>{recipe.description}</Text>}\n {Object.entries(recipe.fields).map(([fieldName, field]) => {\n const controlDisabled =\n disabled || isFieldDisabled?.(theme, recipeName, fieldName) === true;\n const required = isFieldRequired?.(theme, recipeName, fieldName) === true;\n return (\n <Field\n key={fieldName}\n helperText={field.description}\n disabled={controlDisabled}\n label={field.label}\n required={required}\n >\n {renderField({\n theme,\n recipeName,\n fieldName,\n field,\n value: getRecipeFieldValue(theme, recipeName, fieldName),\n disabled: controlDisabled,\n required,\n onChange: (value) => {\n if (!controlDisabled) {\n onRecipeFieldChange?.(theme, recipeName, fieldName, value);\n }\n },\n })}\n </Field>\n );\n })}\n </View>\n </Card>\n ))}\n </View>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pressable } from '@ankhorage/surface';
|
|
1
|
+
import { Pressable } from '@ankhorage/surface/authoring-controls';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableItem.js","sourceRoot":"","sources":["../../../../../src/features/selection/adapters/inbound/SelectableItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SelectableItem.js","sourceRoot":"","sources":["../../../../../src/features/selection/adapters/inbound/SelectableItem.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Pressable } from '@ankhorage/surface/authoring-controls';\nimport type { SelectionIntent } from '@ankhorage/utility/selection';\nimport React from 'react';\nimport { type GestureResponderEvent, Platform } from 'react-native';\n\nimport type {\n SelectableItemProps,\n SelectableItemState,\n SelectionTrigger,\n} from '../../../../types/selection';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { resolveSelectionEventIntent } from '../../application/resolveSelectionEventIntent';\nimport { useSelection } from './SelectionProvider';\n\n/*** Resolve the configured selection trigger. */\nfunction resolveTrigger(trigger: SelectionTrigger | undefined): SelectionTrigger {\n return trigger ?? 'manual';\n}\n\n/*** Narrow render-prop children without changing ordinary React-node children. */\nfunction isRenderProp(\n children: SelectableItemProps['children'],\n): children is (state: SelectableItemState) => React.ReactNode {\n return typeof children === 'function';\n}\n\n/*** Adds selection behavior to arbitrary child content via render props. */\nexport const SelectableItem = withZoraThemeScope(SelectableItemInner);\n\n/*** Render a selectable item inside the inherited ZORA theme scope. */\nfunction SelectableItemInner({\n id,\n trigger,\n disabled = false,\n interactionPolicy,\n children,\n}: SelectableItemProps) {\n const selection = useSelection();\n const resolvedTrigger = resolveTrigger(trigger);\n const resolvedDisabled = selection.disabled || disabled;\n const selected = selection.isSelected(id);\n\n const activate = React.useCallback(\n (intent: SelectionIntent) => {\n if (resolvedDisabled || interactionPolicy === 'passive') return;\n selection.activate(id, intent);\n },\n [id, interactionPolicy, resolvedDisabled, selection],\n );\n const select = React.useCallback(() => {\n if (resolvedDisabled || interactionPolicy === 'passive') return;\n selection.select(id);\n }, [id, interactionPolicy, resolvedDisabled, selection]);\n const toggle = React.useCallback(() => {\n if (resolvedDisabled || interactionPolicy === 'passive') return;\n selection.toggle(id);\n }, [id, interactionPolicy, resolvedDisabled, selection]);\n const clear = React.useCallback(() => {\n if (selection.disabled || interactionPolicy === 'passive') return;\n selection.clear();\n }, [interactionPolicy, selection]);\n\n const itemState = React.useMemo<SelectableItemState>(\n () => ({\n id,\n selected,\n disabled: resolvedDisabled,\n mode: selection.mode,\n activate,\n select,\n toggle,\n clear,\n }),\n [activate, clear, id, resolvedDisabled, select, selected, selection.mode, toggle],\n );\n\n const content = isRenderProp(children) ? children(itemState) : children;\n if (resolvedTrigger === 'manual') return <>{content}</>;\n\n const handleActivation = (event: GestureResponderEvent) => {\n event.stopPropagation();\n if (resolvedDisabled || interactionPolicy === 'passive') return;\n selection.activate(\n id,\n resolveSelectionEventIntent(event, Platform.OS === 'web' ? 'pointer' : 'touch'),\n );\n };\n\n return (\n <Pressable\n interactionPolicy={interactionPolicy}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: resolvedDisabled, selected }}\n disabled={resolvedDisabled}\n onLongPress={resolvedTrigger === 'longPress' ? handleActivation : undefined}\n onPress={resolvedTrigger === 'press' ? handleActivation : undefined}\n >\n {content}\n </Pressable>\n );\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import type { HeadingSize } from '../../../types/heading';
|
|
|
3
3
|
export declare function resolveHeadingThemeRecipe(fields: Readonly<Record<string, ThemeRecipeOverrideValue>>): {
|
|
4
4
|
color: "primary" | "secondary" | "tertiary" | "quaternary" | "neutral" | "error" | "success" | "warning" | "info" | "danger" | undefined;
|
|
5
5
|
emphasis: "default" | "muted" | "subtle" | "inverse" | undefined;
|
|
6
|
-
align: "
|
|
6
|
+
align: "center" | "justify" | "left" | "right" | "auto" | undefined;
|
|
7
7
|
weight: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
8
8
|
italic: boolean | undefined;
|
|
9
9
|
size: HeadingSize | undefined;
|
|
@@ -3,7 +3,7 @@ import type { TextVariant } from '../../../types/text';
|
|
|
3
3
|
export declare function resolveTextThemeRecipe(fields: Readonly<Record<string, ThemeRecipeOverrideValue>>): {
|
|
4
4
|
color: "primary" | "secondary" | "tertiary" | "quaternary" | "neutral" | "error" | "success" | "warning" | "info" | "danger" | undefined;
|
|
5
5
|
emphasis: "default" | "muted" | "subtle" | "inverse" | undefined;
|
|
6
|
-
align: "
|
|
6
|
+
align: "center" | "justify" | "left" | "right" | "auto" | undefined;
|
|
7
7
|
weight: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
8
8
|
italic: boolean | undefined;
|
|
9
9
|
variant: TextVariant | undefined;
|
|
@@ -3,7 +3,7 @@ import type { ThemeRecipeOverrideValue } from '@ankhorage/contracts';
|
|
|
3
3
|
export declare function resolveTypographyThemeRecipeFields(fields: Readonly<Record<string, ThemeRecipeOverrideValue>>): {
|
|
4
4
|
color: "primary" | "secondary" | "tertiary" | "quaternary" | "neutral" | "error" | "success" | "warning" | "info" | "danger" | undefined;
|
|
5
5
|
emphasis: "default" | "muted" | "subtle" | "inverse" | undefined;
|
|
6
|
-
align: "
|
|
6
|
+
align: "center" | "justify" | "left" | "right" | "auto" | undefined;
|
|
7
7
|
weight: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
8
8
|
italic: boolean | undefined;
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "27.
|
|
4
|
+
"version": "27.2.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
},
|
|
121
121
|
"./authoring": {
|
|
122
122
|
"react-native": "./src/authoring.ts",
|
|
123
|
-
"browser": "./
|
|
124
|
-
"types": "./dist/authoring.d.ts",
|
|
123
|
+
"browser": "./web-dist/authoring/index.js",
|
|
124
|
+
"types": "./web-dist/authoring/index.d.ts",
|
|
125
125
|
"import": "./dist/authoring.js",
|
|
126
126
|
"default": "./dist/authoring.js"
|
|
127
127
|
},
|
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
"prepack": "bun run build",
|
|
157
157
|
"test": "bun run build && bun test src examples/grid-workspaces/time examples/grid-workspaces/plugins --isolate",
|
|
158
158
|
"test:packed-web-consumer": "bun scripts/verify-packed-web-consumer.ts",
|
|
159
|
+
"test:packed-authoring-consumer": "bun scripts/verify-packed-web-consumer.ts --authoring",
|
|
159
160
|
"test:chess:chromium": "bun scripts/test-chess-chromium.ts",
|
|
160
161
|
"test:graph-view:chromium": "bun scripts/test-graph-view-chromium.ts",
|
|
161
162
|
"typecheck": "bun x tsc --noEmit -p tsconfig.json && bun x tsc --noEmit -p tsconfig.scripts.json && bun x tsc -p tsconfig.typecheck.json",
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
},
|
|
164
165
|
"devDependencies": {
|
|
165
166
|
"@ankhorage/devtools": "^2.3.47",
|
|
166
|
-
"@ankhorage/paradox": "^0.
|
|
167
|
+
"@ankhorage/paradox": "^0.5.0",
|
|
167
168
|
"@react-native-vector-icons/fontawesome": "^14.0.0",
|
|
168
169
|
"@react-native-vector-icons/fontawesome5": "^14.0.0",
|
|
169
170
|
"@react-native-vector-icons/fontawesome6": "^14.0.0",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';
|
|
2
|
+
export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';
|
|
3
|
+
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
|
+
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
|
+
export type {
|
|
6
|
+
AuthoringBindingControlState,
|
|
7
|
+
AuthoringBindingEditorAdapterProps,
|
|
8
|
+
AuthoringPropertyControlState,
|
|
9
|
+
AuthoringPropertyInspectorAdapterProps,
|
|
10
|
+
AuthoringSelectionAdapterProps,
|
|
11
|
+
AuthoringSelectionItemState,
|
|
12
|
+
ThemeEditorAdapterProps,
|
|
13
|
+
ThemeRecipeFieldControlState,
|
|
14
|
+
} from './types/authoring-adapters';
|
|
15
|
+
export type {
|
|
16
|
+
ButtonProps,
|
|
17
|
+
CardProps,
|
|
18
|
+
FieldProps,
|
|
19
|
+
PressableProps,
|
|
20
|
+
TextInputProps,
|
|
21
|
+
TextProps,
|
|
22
|
+
ThemeProviderProps,
|
|
23
|
+
ThemeRuntime,
|
|
24
|
+
ViewProps,
|
|
25
|
+
} from '@ankhorage/surface/authoring-controls';
|
|
26
|
+
export {
|
|
27
|
+
Button,
|
|
28
|
+
Card,
|
|
29
|
+
Field,
|
|
30
|
+
Pressable,
|
|
31
|
+
Text,
|
|
32
|
+
TextInput,
|
|
33
|
+
ThemeProvider,
|
|
34
|
+
useTheme,
|
|
35
|
+
View,
|
|
36
|
+
} from '@ankhorage/surface/authoring-controls';
|
package/src/authoring.ts
CHANGED
|
@@ -12,3 +12,25 @@ export type {
|
|
|
12
12
|
ThemeEditorAdapterProps,
|
|
13
13
|
ThemeRecipeFieldControlState,
|
|
14
14
|
} from './types/authoring-adapters';
|
|
15
|
+
export type {
|
|
16
|
+
ButtonProps,
|
|
17
|
+
CardProps,
|
|
18
|
+
FieldProps,
|
|
19
|
+
PressableProps,
|
|
20
|
+
TextInputProps,
|
|
21
|
+
TextProps,
|
|
22
|
+
ThemeProviderProps,
|
|
23
|
+
ThemeRuntime,
|
|
24
|
+
ViewProps,
|
|
25
|
+
} from '@ankhorage/surface/authoring-controls';
|
|
26
|
+
export {
|
|
27
|
+
Button,
|
|
28
|
+
Card,
|
|
29
|
+
Field,
|
|
30
|
+
Pressable,
|
|
31
|
+
Text,
|
|
32
|
+
TextInput,
|
|
33
|
+
ThemeProvider,
|
|
34
|
+
useTheme,
|
|
35
|
+
View,
|
|
36
|
+
} from '@ankhorage/surface/authoring-controls';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Field, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import type { AuthoringBindingEditorAdapterProps } from '../../../../types/authoring-adapters';
|
|
4
|
-
import { Field } from '../../../form/public';
|
|
5
|
-
import { View } from '../../../layout/public';
|
|
6
5
|
|
|
7
6
|
/*** Presents canonical bindable properties while leaving binding representation and mutation ownership external. */
|
|
8
7
|
export function AuthoringBindingEditorAdapter<TNode, TBinding>({
|
|
@@ -27,7 +26,7 @@ export function AuthoringBindingEditorAdapter<TNode, TBinding>({
|
|
|
27
26
|
return (
|
|
28
27
|
<Field
|
|
29
28
|
key={name}
|
|
30
|
-
|
|
29
|
+
helperText={meta.description}
|
|
31
30
|
disabled={controlDisabled}
|
|
32
31
|
label={meta.label ?? name}
|
|
33
32
|
required={required}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { Field, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import type { AuthoringPropertyInspectorAdapterProps } from '../../../../types/authoring-adapters';
|
|
4
|
-
import { Field } from '../../../form/public';
|
|
5
|
-
import { View } from '../../../layout/public';
|
|
6
5
|
|
|
7
6
|
/*** Presents canonical component properties while keeping node storage and mutations with the consumer. */
|
|
8
7
|
export function AuthoringPropertyInspectorAdapter<TNode>({
|
|
@@ -25,7 +24,7 @@ export function AuthoringPropertyInspectorAdapter<TNode>({
|
|
|
25
24
|
return (
|
|
26
25
|
<Field
|
|
27
26
|
key={name}
|
|
28
|
-
|
|
27
|
+
helperText={schema.label === undefined ? undefined : schema.category}
|
|
29
28
|
disabled={controlDisabled}
|
|
30
29
|
label={schema.label ?? name}
|
|
31
30
|
required={required}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { Card, Field, Text, View } from '@ankhorage/surface/authoring-controls';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import type { ThemeEditorAdapterProps } from '../../../../types/authoring-adapters';
|
|
4
|
-
import { Card } from '../../../card/public';
|
|
5
|
-
import { Field } from '../../../form/public';
|
|
6
|
-
import { View } from '../../../layout/public';
|
|
7
5
|
import { ZORA_THEME_RECIPE_META } from '../../themeRecipeMeta';
|
|
8
6
|
|
|
9
7
|
/*** Presents ZORA recipe fields without taking ownership of a consumer's theme document. */
|
|
@@ -22,8 +20,10 @@ export function ThemeEditorAdapter<TTheme>({
|
|
|
22
20
|
return (
|
|
23
21
|
<View gap="m">
|
|
24
22
|
{Object.entries(recipes).map(([recipeName, recipe]) => (
|
|
25
|
-
<Card key={recipeName}
|
|
23
|
+
<Card key={recipeName}>
|
|
26
24
|
<View gap="m">
|
|
25
|
+
<Text>{recipe.name}</Text>
|
|
26
|
+
{recipe.description === undefined ? null : <Text>{recipe.description}</Text>}
|
|
27
27
|
{Object.entries(recipe.fields).map(([fieldName, field]) => {
|
|
28
28
|
const controlDisabled =
|
|
29
29
|
disabled || isFieldDisabled?.(theme, recipeName, fieldName) === true;
|
|
@@ -31,7 +31,7 @@ export function ThemeEditorAdapter<TTheme>({
|
|
|
31
31
|
return (
|
|
32
32
|
<Field
|
|
33
33
|
key={fieldName}
|
|
34
|
-
|
|
34
|
+
helperText={field.description}
|
|
35
35
|
disabled={controlDisabled}
|
|
36
36
|
label={field.label}
|
|
37
37
|
required={required}
|
|
@@ -77,6 +77,7 @@ describe('authoring adapters', () => {
|
|
|
77
77
|
|
|
78
78
|
expect(selected).toEqual([{ id: 'second' }, null]);
|
|
79
79
|
expect(findElement(element, 'SelectionProvider')?.props.selectedIds).toEqual(['first']);
|
|
80
|
+
expect(findElement(element, 'SelectableItem')).toBeDefined();
|
|
80
81
|
});
|
|
81
82
|
|
|
82
83
|
test('passes required state and real property mutations while preventing disabled mutations', async () => {
|
|
@@ -198,13 +199,18 @@ async function loadAdapters(): Promise<LoadedAdapters> {
|
|
|
198
199
|
name: 'inert-zora-authoring-controls',
|
|
199
200
|
setup(builder) {
|
|
200
201
|
builder.onResolve(
|
|
201
|
-
{
|
|
202
|
+
{
|
|
203
|
+
filter:
|
|
204
|
+
/(?:card|form|layout|registry|selection)\/public$|@ankhorage\/surface\/authoring-controls/u,
|
|
205
|
+
},
|
|
202
206
|
({ path }) => ({ path, namespace: 'inert-zora-controls' }),
|
|
203
207
|
);
|
|
204
208
|
builder.onLoad({ filter: /.*/u, namespace: 'inert-zora-controls' }, () => ({
|
|
205
209
|
loader: 'js',
|
|
206
|
-
contents: `export const Card='Card', Field='Field',
|
|
207
|
-
|
|
210
|
+
contents: `export const Button='Button', Card='Card', Field='Field', Pressable='Pressable', Text='Text',
|
|
211
|
+
TextInput='TextInput', ThemeProvider='ThemeProvider', useTheme=()=>undefined,
|
|
212
|
+
View='View', SelectableItem='SelectableItem', SelectionProvider='SelectionProvider',
|
|
213
|
+
useSelection=()=>({ disabled:false, isSelected:()=>false, select:()=>undefined });`,
|
|
208
214
|
}));
|
|
209
215
|
},
|
|
210
216
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pressable } from '@ankhorage/surface';
|
|
1
|
+
import { Pressable } from '@ankhorage/surface/authoring-controls';
|
|
2
2
|
import type { SelectionIntent } from '@ankhorage/utility/selection';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { type GestureResponderEvent, Platform } from 'react-native';
|
|
@@ -18,3 +18,27 @@ test(
|
|
|
18
18
|
},
|
|
19
19
|
{ timeout: 120_000 },
|
|
20
20
|
);
|
|
21
|
+
|
|
22
|
+
/** Verifies the published authoring package in an independent Vite/RNW consumer installation. */
|
|
23
|
+
test(
|
|
24
|
+
'installs, renders, and bundles the public authoring entrypoint',
|
|
25
|
+
() => {
|
|
26
|
+
const subprocess = Bun.spawnSync({
|
|
27
|
+
cmd: [
|
|
28
|
+
process.execPath,
|
|
29
|
+
'scripts/verify-packed-web-consumer.ts',
|
|
30
|
+
'--skip-build',
|
|
31
|
+
'--authoring',
|
|
32
|
+
],
|
|
33
|
+
stderr: 'pipe',
|
|
34
|
+
stdout: 'pipe',
|
|
35
|
+
});
|
|
36
|
+
const output = `${subprocess.stdout.toString()}\n${subprocess.stderr.toString()}`;
|
|
37
|
+
|
|
38
|
+
expect(subprocess.exitCode, output).toBe(0);
|
|
39
|
+
expect(output).toContain(
|
|
40
|
+
'Packed ZORA authoring consumer Vite/RNW render and controlled selection passed.',
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
{ timeout: 120_000 },
|
|
44
|
+
);
|
|
@@ -12,6 +12,16 @@ const forbiddenWebDependencies = [
|
|
|
12
12
|
'react-native-gesture-handler',
|
|
13
13
|
] as const;
|
|
14
14
|
|
|
15
|
+
const authoringControls = [
|
|
16
|
+
'Button',
|
|
17
|
+
'Card',
|
|
18
|
+
'Field',
|
|
19
|
+
'Pressable',
|
|
20
|
+
'Text',
|
|
21
|
+
'TextInput',
|
|
22
|
+
'View',
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
15
25
|
/** Verifies that stable package web subpaths resolve only their requested UI graph. */
|
|
16
26
|
test('publishes SSR-safe ordinary UI through canonical web subpaths', async () => {
|
|
17
27
|
const packageJson = (await Bun.file('package.json').json()) as {
|
|
@@ -107,3 +117,11 @@ test('SSR-renders ordinary UI from its public web subpaths', async () => {
|
|
|
107
117
|
expect(markup).toContain('Web entrypoint');
|
|
108
118
|
expect(markup).toContain('Continue');
|
|
109
119
|
});
|
|
120
|
+
|
|
121
|
+
/** Verifies that the authoring boundary delegates its portable controls to released Surface. */
|
|
122
|
+
test('publishes browser-safe authoring controls through the released Surface boundary', async () => {
|
|
123
|
+
const entrypoint = await Bun.file(join('src', 'authoring.ts')).text();
|
|
124
|
+
expect(entrypoint).toContain("from '@ankhorage/surface/authoring-controls'");
|
|
125
|
+
for (const control of authoringControls) expect(entrypoint).toContain(control);
|
|
126
|
+
expect(entrypoint).not.toContain("from './features/theme/runtime'");
|
|
127
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AuthoringBindingEditorAdapter } from './features/registry/adapters/inbound/AuthoringBindingEditorAdapter';
|
|
2
|
+
export { AuthoringPropertyInspectorAdapter } from './features/registry/adapters/inbound/AuthoringPropertyInspectorAdapter';
|
|
3
|
+
export { AuthoringSelectionAdapter } from './features/registry/adapters/inbound/AuthoringSelectionAdapter';
|
|
4
|
+
export { ThemeEditorAdapter } from './features/registry/adapters/inbound/ThemeEditorAdapter';
|
|
5
|
+
export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps, AuthoringPropertyControlState, AuthoringPropertyInspectorAdapterProps, AuthoringSelectionAdapterProps, AuthoringSelectionItemState, ThemeEditorAdapterProps, ThemeRecipeFieldControlState, } from './types/authoring-adapters';
|
|
6
|
+
export type { ButtonProps, CardProps, FieldProps, PressableProps, TextInputProps, TextProps, ThemeProviderProps, ThemeRuntime, ViewProps, } from '@ankhorage/surface/authoring-controls';
|
|
7
|
+
export { Button, Card, Field, Pressable, Text, TextInput, ThemeProvider, useTheme, View, } from '@ankhorage/surface/authoring-controls';
|
|
8
|
+
//# sourceMappingURL=authoring.browser.d.ts.map
|