@gtkx/react 0.20.0 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -55
- package/dist/components/application.d.ts +10 -0
- package/dist/components/application.d.ts.map +1 -0
- package/dist/components/application.js +26 -0
- package/dist/components/application.js.map +1 -0
- package/dist/components/window.d.ts +8 -0
- package/dist/components/window.d.ts.map +1 -0
- package/dist/components/window.js +23 -0
- package/dist/components/window.js.map +1 -0
- package/dist/hooks/use-application.d.ts +8 -0
- package/dist/hooks/use-application.d.ts.map +1 -0
- package/dist/hooks/use-application.js +13 -0
- package/dist/hooks/use-application.js.map +1 -0
- package/dist/hooks/use-bind-setting.d.ts +6 -0
- package/dist/hooks/use-bind-setting.d.ts.map +1 -0
- package/dist/hooks/use-bind-setting.js +19 -0
- package/dist/hooks/use-bind-setting.js.map +1 -0
- package/dist/hooks/use-merge-refs.d.ts +3 -0
- package/dist/hooks/use-merge-refs.d.ts.map +1 -0
- package/dist/hooks/use-merge-refs.js +48 -0
- package/dist/hooks/use-merge-refs.js.map +1 -0
- package/dist/hooks/use-object-attachment.d.ts +10 -0
- package/dist/hooks/use-object-attachment.d.ts.map +1 -0
- package/dist/hooks/use-object-attachment.js +24 -0
- package/dist/hooks/use-object-attachment.js.map +1 -0
- package/dist/hooks/use-object-value.d.ts +4 -0
- package/dist/hooks/use-object-value.d.ts.map +1 -0
- package/dist/hooks/use-object-value.js +32 -0
- package/dist/hooks/use-object-value.js.map +1 -0
- package/dist/hooks/use-parent-window.d.ts +8 -0
- package/dist/hooks/use-parent-window.d.ts.map +1 -0
- package/dist/hooks/use-parent-window.js +7 -0
- package/dist/hooks/use-parent-window.js.map +1 -0
- package/dist/hooks/use-property.d.ts +14 -0
- package/dist/hooks/use-property.d.ts.map +1 -0
- package/dist/hooks/use-property.js +13 -0
- package/dist/hooks/use-property.js.map +1 -0
- package/dist/hooks/use-setting.d.ts +25 -0
- package/dist/hooks/use-setting.d.ts.map +1 -0
- package/dist/hooks/use-setting.js +15 -0
- package/dist/hooks/use-setting.js.map +1 -0
- package/dist/hooks/use-signal.d.ts +21 -0
- package/dist/hooks/use-signal.d.ts.map +1 -0
- package/dist/hooks/use-signal.js +20 -0
- package/dist/hooks/use-signal.js.map +1 -0
- package/dist/index.d.ts +14 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +14 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +14 -0
- package/dist/internal.js.map +1 -0
- package/dist/libraries/adw/dialog.d.ts +8 -0
- package/dist/libraries/adw/dialog.d.ts.map +1 -0
- package/dist/libraries/adw/dialog.js +25 -0
- package/dist/libraries/adw/dialog.js.map +1 -0
- package/dist/libraries/adw/index.d.ts +2 -0
- package/dist/libraries/adw/index.d.ts.map +1 -0
- package/dist/libraries/adw/index.js +2 -0
- package/dist/libraries/adw/index.js.map +1 -0
- package/dist/reconciler/accessible.d.ts +59 -0
- package/dist/reconciler/accessible.d.ts.map +1 -0
- package/dist/reconciler/accessible.js +143 -0
- package/dist/reconciler/accessible.js.map +1 -0
- package/dist/reconciler/apply-props.d.ts +8 -0
- package/dist/reconciler/apply-props.d.ts.map +1 -0
- package/dist/reconciler/apply-props.js +92 -0
- package/dist/reconciler/apply-props.js.map +1 -0
- package/dist/reconciler/commit-flush.d.ts +3 -0
- package/dist/reconciler/commit-flush.d.ts.map +1 -0
- package/dist/reconciler/commit-flush.js +13 -0
- package/dist/reconciler/commit-flush.js.map +1 -0
- package/dist/reconciler/container-attach.d.ts +10 -0
- package/dist/reconciler/container-attach.d.ts.map +1 -0
- package/dist/reconciler/container-attach.js +216 -0
- package/dist/reconciler/container-attach.js.map +1 -0
- package/dist/reconciler/content-rebuild.d.ts +3 -0
- package/dist/reconciler/content-rebuild.d.ts.map +1 -0
- package/dist/reconciler/content-rebuild.js +15 -0
- package/dist/reconciler/content-rebuild.js.map +1 -0
- package/dist/reconciler/dispatch.d.ts +6 -0
- package/dist/reconciler/dispatch.d.ts.map +1 -0
- package/dist/reconciler/dispatch.js +61 -0
- package/dist/reconciler/dispatch.js.map +1 -0
- package/dist/reconciler/element-prop-appliers.d.ts +5 -0
- package/dist/reconciler/element-prop-appliers.d.ts.map +1 -0
- package/dist/reconciler/element-prop-appliers.js +104 -0
- package/dist/reconciler/element-prop-appliers.js.map +1 -0
- package/dist/reconciler/element-props.d.ts +25 -0
- package/dist/reconciler/element-props.d.ts.map +1 -0
- package/dist/reconciler/element-props.js +157 -0
- package/dist/reconciler/element-props.js.map +1 -0
- package/dist/reconciler/host-config.d.ts +13 -0
- package/dist/reconciler/host-config.d.ts.map +1 -0
- package/dist/reconciler/host-config.js +309 -0
- package/dist/reconciler/host-config.js.map +1 -0
- package/dist/reconciler/instance.d.ts +6 -0
- package/dist/reconciler/instance.d.ts.map +1 -0
- package/dist/reconciler/instance.js +27 -0
- package/dist/reconciler/instance.js.map +1 -0
- package/dist/reconciler/label-text-rebuild.d.ts +3 -0
- package/dist/reconciler/label-text-rebuild.d.ts.map +1 -0
- package/dist/reconciler/label-text-rebuild.js +22 -0
- package/dist/reconciler/label-text-rebuild.js.map +1 -0
- package/dist/reconciler/portal.d.ts +11 -0
- package/dist/reconciler/portal.d.ts.map +1 -0
- package/dist/reconciler/portal.js +20 -0
- package/dist/reconciler/portal.js.map +1 -0
- package/dist/reconciler/reconciler-error-handler.d.ts +7 -0
- package/dist/reconciler/reconciler-error-handler.d.ts.map +1 -0
- package/dist/reconciler/reconciler-error-handler.js +24 -0
- package/dist/reconciler/reconciler-error-handler.js.map +1 -0
- package/dist/reconciler/reconciler-root.d.ts +19 -0
- package/dist/reconciler/reconciler-root.d.ts.map +1 -0
- package/dist/reconciler/reconciler-root.js +24 -0
- package/dist/reconciler/reconciler-root.js.map +1 -0
- package/dist/reconciler/reconciler.d.ts +3 -0
- package/dist/reconciler/reconciler.d.ts.map +1 -0
- package/dist/reconciler/reconciler.js +12 -0
- package/dist/reconciler/reconciler.js.map +1 -0
- package/dist/reconciler/render.d.ts +23 -0
- package/dist/reconciler/render.d.ts.map +1 -0
- package/dist/reconciler/render.js +46 -0
- package/dist/reconciler/render.js.map +1 -0
- package/dist/reconciler/root-element.d.ts +14 -0
- package/dist/reconciler/root-element.d.ts.map +1 -0
- package/dist/reconciler/root-element.js +7 -0
- package/dist/reconciler/root-element.js.map +1 -0
- package/dist/reconciler/signal-store.d.ts +22 -0
- package/dist/reconciler/signal-store.d.ts.map +1 -0
- package/dist/reconciler/signal-store.js +84 -0
- package/dist/reconciler/signal-store.js.map +1 -0
- package/dist/reconciler/state.d.ts +36 -0
- package/dist/reconciler/state.d.ts.map +1 -0
- package/dist/reconciler/state.js +38 -0
- package/dist/reconciler/state.js.map +1 -0
- package/dist/reconciler/text-buffer-controller.d.ts +17 -0
- package/dist/reconciler/text-buffer-controller.d.ts.map +1 -0
- package/dist/reconciler/text-buffer-controller.js +102 -0
- package/dist/reconciler/text-buffer-controller.js.map +1 -0
- package/dist/reconciler/text-buffer-rebuild.d.ts +3 -0
- package/dist/reconciler/text-buffer-rebuild.d.ts.map +1 -0
- package/dist/reconciler/text-buffer-rebuild.js +7 -0
- package/dist/reconciler/text-buffer-rebuild.js.map +1 -0
- package/dist/reconciler/text-node.d.ts +7 -0
- package/dist/reconciler/text-node.d.ts.map +1 -0
- package/dist/reconciler/text-node.js +8 -0
- package/dist/reconciler/text-node.js.map +1 -0
- package/dist/reconciler/types.d.ts +5 -0
- package/dist/reconciler/types.d.ts.map +1 -0
- package/dist/reconciler/types.js.map +1 -0
- package/dist/reconciler/visibility.d.ts +6 -0
- package/dist/reconciler/visibility.d.ts.map +1 -0
- package/dist/reconciler/visibility.js +57 -0
- package/dist/reconciler/visibility.js.map +1 -0
- package/dist/reconciler/wrapper-apply.d.ts +6 -0
- package/dist/reconciler/wrapper-apply.d.ts.map +1 -0
- package/dist/reconciler/wrapper-apply.js +287 -0
- package/dist/reconciler/wrapper-apply.js.map +1 -0
- package/dist/reconciler/wrapper-content.d.ts +8 -0
- package/dist/reconciler/wrapper-content.d.ts.map +1 -0
- package/dist/reconciler/wrapper-content.js +19 -0
- package/dist/reconciler/wrapper-content.js.map +1 -0
- package/dist/reconciler/wrapper-node.d.ts +8 -0
- package/dist/reconciler/wrapper-node.d.ts.map +1 -0
- package/dist/reconciler/wrapper-node.js +4 -0
- package/dist/reconciler/wrapper-node.js.map +1 -0
- package/dist/reconciler/wrapper-protocol.d.ts +13 -0
- package/dist/reconciler/wrapper-protocol.d.ts.map +1 -0
- package/dist/reconciler/wrapper-protocol.js +20 -0
- package/dist/reconciler/wrapper-protocol.js.map +1 -0
- package/dist/utils/accessible-metadata.d.ts +5 -0
- package/dist/utils/accessible-metadata.d.ts.map +1 -0
- package/dist/utils/accessible-metadata.js +22 -0
- package/dist/utils/accessible-metadata.js.map +1 -0
- package/dist/utils/create-element-component.d.ts +4 -0
- package/dist/utils/create-element-component.d.ts.map +1 -0
- package/dist/utils/create-element-component.js +54 -0
- package/dist/utils/create-element-component.js.map +1 -0
- package/dist/utils/gtype.d.ts +16 -0
- package/dist/utils/gtype.d.ts.map +1 -0
- package/dist/utils/gtype.js +127 -0
- package/dist/utils/gtype.js.map +1 -0
- package/dist/utils/notify-name.d.ts +5 -0
- package/dist/utils/notify-name.d.ts.map +1 -0
- package/dist/utils/notify-name.js +6 -0
- package/dist/utils/notify-name.js.map +1 -0
- package/dist/utils/object-prop.d.ts +8 -0
- package/dist/utils/object-prop.d.ts.map +1 -0
- package/dist/utils/object-prop.js +9 -0
- package/dist/utils/object-prop.js.map +1 -0
- package/dist/utils/settings-accessor.d.ts +8 -0
- package/dist/utils/settings-accessor.d.ts.map +1 -0
- package/dist/utils/settings-accessor.js +69 -0
- package/dist/utils/settings-accessor.js.map +1 -0
- package/dist/utils/wrapper-node-jsx.d.ts +32 -0
- package/dist/utils/wrapper-node-jsx.d.ts.map +1 -0
- package/dist/utils/wrapper-node-jsx.js +2 -0
- package/dist/utils/wrapper-node-jsx.js.map +1 -0
- package/package.json +22 -8
- package/src/components/application.tsx +43 -0
- package/src/components/window.tsx +36 -0
- package/src/hooks/use-application.ts +17 -0
- package/src/hooks/use-bind-setting.ts +35 -0
- package/src/hooks/use-merge-refs.ts +53 -0
- package/src/hooks/use-object-attachment.ts +35 -0
- package/src/hooks/use-object-value.ts +50 -0
- package/src/hooks/use-parent-window.ts +9 -0
- package/src/hooks/use-property.ts +22 -0
- package/src/hooks/use-setting.ts +47 -0
- package/src/hooks/use-signal.ts +71 -0
- package/src/index.ts +15 -12
- package/src/internal.ts +24 -0
- package/src/libraries/adw/dialog.tsx +34 -0
- package/src/libraries/adw/index.ts +1 -0
- package/src/reconciler/accessible.ts +232 -0
- package/src/reconciler/apply-props.ts +117 -0
- package/src/reconciler/commit-flush.ts +13 -0
- package/src/reconciler/container-attach.ts +219 -0
- package/src/reconciler/content-rebuild.ts +19 -0
- package/src/reconciler/dispatch.ts +58 -0
- package/src/reconciler/element-prop-appliers.ts +110 -0
- package/src/reconciler/element-props.ts +192 -0
- package/src/reconciler/host-config.ts +405 -0
- package/src/reconciler/instance.ts +30 -0
- package/src/reconciler/label-text-rebuild.ts +26 -0
- package/src/reconciler/portal.ts +28 -0
- package/src/reconciler/reconciler-error-handler.ts +29 -0
- package/src/reconciler/reconciler-root.ts +57 -0
- package/src/reconciler/reconciler.ts +13 -0
- package/src/reconciler/render.ts +61 -0
- package/src/reconciler/root-element.ts +14 -0
- package/src/reconciler/signal-store.ts +103 -0
- package/src/reconciler/state.ts +72 -0
- package/src/reconciler/text-buffer-controller.ts +107 -0
- package/src/reconciler/text-buffer-rebuild.ts +12 -0
- package/src/reconciler/text-node.ts +13 -0
- package/src/reconciler/types.ts +6 -0
- package/src/reconciler/visibility.ts +52 -0
- package/src/reconciler/wrapper-apply.ts +308 -0
- package/src/reconciler/wrapper-content.ts +24 -0
- package/src/reconciler/wrapper-node.ts +8 -0
- package/src/reconciler/wrapper-protocol.ts +32 -0
- package/src/utils/accessible-metadata.ts +26 -0
- package/src/utils/create-element-component.ts +77 -0
- package/src/utils/gtype.ts +166 -0
- package/src/utils/notify-name.ts +10 -0
- package/src/utils/object-prop.ts +13 -0
- package/src/utils/settings-accessor.ts +89 -0
- package/src/utils/wrapper-node-jsx.ts +34 -0
- package/dist/components/list.d.ts +0 -35
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/list.js +0 -40
- package/dist/components/list.js.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -42
- package/dist/errors.js.map +0 -1
- package/dist/factory.d.ts +0 -5
- package/dist/factory.d.ts.map +0 -1
- package/dist/factory.js +0 -37
- package/dist/factory.js.map +0 -1
- package/dist/generated/internal.d.ts +0 -16
- package/dist/generated/internal.d.ts.map +0 -1
- package/dist/generated/internal.js +0 -5635
- package/dist/generated/internal.js.map +0 -1
- package/dist/generated/jsx.d.ts +0 -19624
- package/dist/generated/jsx.d.ts.map +0 -1
- package/dist/generated/jsx.js +0 -9274
- package/dist/generated/jsx.js.map +0 -1
- package/dist/generated/registry.d.ts +0 -4
- package/dist/generated/registry.d.ts.map +0 -1
- package/dist/generated/registry.js +0 -14
- package/dist/generated/registry.js.map +0 -1
- package/dist/host-config.d.ts +0 -24
- package/dist/host-config.d.ts.map +0 -1
- package/dist/host-config.js +0 -172
- package/dist/host-config.js.map +0 -1
- package/dist/jsx.d.ts +0 -1272
- package/dist/jsx.d.ts.map +0 -1
- package/dist/jsx.js +0 -331
- package/dist/jsx.js.map +0 -1
- package/dist/metadata.d.ts +0 -5
- package/dist/metadata.d.ts.map +0 -1
- package/dist/metadata.js +0 -33
- package/dist/metadata.js.map +0 -1
- package/dist/node.d.ts +0 -25
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -85
- package/dist/node.js.map +0 -1
- package/dist/nodes/adjustable.d.ts +0 -11
- package/dist/nodes/adjustable.d.ts.map +0 -1
- package/dist/nodes/adjustable.js +0 -46
- package/dist/nodes/adjustable.js.map +0 -1
- package/dist/nodes/alert-dialog-response.d.ts +0 -15
- package/dist/nodes/alert-dialog-response.d.ts.map +0 -1
- package/dist/nodes/alert-dialog-response.js +0 -61
- package/dist/nodes/alert-dialog-response.js.map +0 -1
- package/dist/nodes/animation.d.ts +0 -38
- package/dist/nodes/animation.d.ts.map +0 -1
- package/dist/nodes/animation.js +0 -310
- package/dist/nodes/animation.js.map +0 -1
- package/dist/nodes/application.d.ts +0 -12
- package/dist/nodes/application.d.ts.map +0 -1
- package/dist/nodes/application.js +0 -51
- package/dist/nodes/application.js.map +0 -1
- package/dist/nodes/calendar.d.ts +0 -18
- package/dist/nodes/calendar.d.ts.map +0 -1
- package/dist/nodes/calendar.js +0 -28
- package/dist/nodes/calendar.js.map +0 -1
- package/dist/nodes/color-dialog-button.d.ts +0 -15
- package/dist/nodes/color-dialog-button.d.ts.map +0 -1
- package/dist/nodes/color-dialog-button.js +0 -43
- package/dist/nodes/color-dialog-button.js.map +0 -1
- package/dist/nodes/column-view-column.d.ts +0 -36
- package/dist/nodes/column-view-column.d.ts.map +0 -1
- package/dist/nodes/column-view-column.js +0 -168
- package/dist/nodes/column-view-column.js.map +0 -1
- package/dist/nodes/container-slot.d.ts +0 -16
- package/dist/nodes/container-slot.d.ts.map +0 -1
- package/dist/nodes/container-slot.js +0 -69
- package/dist/nodes/container-slot.js.map +0 -1
- package/dist/nodes/dialog.d.ts +0 -10
- package/dist/nodes/dialog.d.ts.map +0 -1
- package/dist/nodes/dialog.js +0 -20
- package/dist/nodes/dialog.js.map +0 -1
- package/dist/nodes/drawing-area.d.ts +0 -17
- package/dist/nodes/drawing-area.d.ts.map +0 -1
- package/dist/nodes/drawing-area.js +0 -42
- package/dist/nodes/drawing-area.js.map +0 -1
- package/dist/nodes/event-controller.d.ts +0 -15
- package/dist/nodes/event-controller.d.ts.map +0 -1
- package/dist/nodes/event-controller.js +0 -77
- package/dist/nodes/event-controller.js.map +0 -1
- package/dist/nodes/fixed-child.d.ts +0 -18
- package/dist/nodes/fixed-child.d.ts.map +0 -1
- package/dist/nodes/fixed-child.js +0 -86
- package/dist/nodes/fixed-child.js.map +0 -1
- package/dist/nodes/font-dialog-button.d.ts +0 -15
- package/dist/nodes/font-dialog-button.d.ts.map +0 -1
- package/dist/nodes/font-dialog-button.js +0 -76
- package/dist/nodes/font-dialog-button.js.map +0 -1
- package/dist/nodes/grid-child.d.ts +0 -18
- package/dist/nodes/grid-child.d.ts.map +0 -1
- package/dist/nodes/grid-child.js +0 -81
- package/dist/nodes/grid-child.js.map +0 -1
- package/dist/nodes/internal/accessible.d.ts +0 -5
- package/dist/nodes/internal/accessible.d.ts.map +0 -1
- package/dist/nodes/internal/accessible.js +0 -119
- package/dist/nodes/internal/accessible.js.map +0 -1
- package/dist/nodes/internal/bound-item.d.ts +0 -4
- package/dist/nodes/internal/bound-item.d.ts.map +0 -1
- package/dist/nodes/internal/bound-item.js +0 -2
- package/dist/nodes/internal/bound-item.js.map +0 -1
- package/dist/nodes/internal/construct.d.ts +0 -3
- package/dist/nodes/internal/construct.d.ts.map +0 -1
- package/dist/nodes/internal/construct.js +0 -44
- package/dist/nodes/internal/construct.js.map +0 -1
- package/dist/nodes/internal/predicates.d.ts +0 -51
- package/dist/nodes/internal/predicates.d.ts.map +0 -1
- package/dist/nodes/internal/predicates.js +0 -36
- package/dist/nodes/internal/predicates.js.map +0 -1
- package/dist/nodes/internal/props.d.ts +0 -6
- package/dist/nodes/internal/props.d.ts.map +0 -1
- package/dist/nodes/internal/props.js +0 -43
- package/dist/nodes/internal/props.js.map +0 -1
- package/dist/nodes/internal/signal-store.d.ts +0 -22
- package/dist/nodes/internal/signal-store.d.ts.map +0 -1
- package/dist/nodes/internal/signal-store.js +0 -98
- package/dist/nodes/internal/signal-store.js.map +0 -1
- package/dist/nodes/internal/text-buffer-controller.d.ts +0 -40
- package/dist/nodes/internal/text-buffer-controller.d.ts.map +0 -1
- package/dist/nodes/internal/text-buffer-controller.js +0 -327
- package/dist/nodes/internal/text-buffer-controller.js.map +0 -1
- package/dist/nodes/internal/widget.d.ts +0 -8
- package/dist/nodes/internal/widget.d.ts.map +0 -1
- package/dist/nodes/internal/widget.js +0 -72
- package/dist/nodes/internal/widget.js.map +0 -1
- package/dist/nodes/level-bar.d.ts +0 -12
- package/dist/nodes/level-bar.d.ts.map +0 -1
- package/dist/nodes/level-bar.js +0 -24
- package/dist/nodes/level-bar.js.map +0 -1
- package/dist/nodes/list-item-node.d.ts +0 -12
- package/dist/nodes/list-item-node.d.ts.map +0 -1
- package/dist/nodes/list-item-node.js +0 -23
- package/dist/nodes/list-item-node.js.map +0 -1
- package/dist/nodes/list.d.ts +0 -100
- package/dist/nodes/list.d.ts.map +0 -1
- package/dist/nodes/list.js +0 -950
- package/dist/nodes/list.js.map +0 -1
- package/dist/nodes/menu.d.ts +0 -7
- package/dist/nodes/menu.d.ts.map +0 -1
- package/dist/nodes/menu.js +0 -20
- package/dist/nodes/menu.js.map +0 -1
- package/dist/nodes/models/menu.d.ts +0 -47
- package/dist/nodes/models/menu.d.ts.map +0 -1
- package/dist/nodes/models/menu.js +0 -240
- package/dist/nodes/models/menu.js.map +0 -1
- package/dist/nodes/navigation-page.d.ts +0 -19
- package/dist/nodes/navigation-page.d.ts.map +0 -1
- package/dist/nodes/navigation-page.js +0 -129
- package/dist/nodes/navigation-page.js.map +0 -1
- package/dist/nodes/navigation-view.d.ts +0 -19
- package/dist/nodes/navigation-view.d.ts.map +0 -1
- package/dist/nodes/navigation-view.js +0 -51
- package/dist/nodes/navigation-view.js.map +0 -1
- package/dist/nodes/notebook-page-tab.d.ts +0 -15
- package/dist/nodes/notebook-page-tab.d.ts.map +0 -1
- package/dist/nodes/notebook-page-tab.js +0 -40
- package/dist/nodes/notebook-page-tab.js.map +0 -1
- package/dist/nodes/notebook-page.d.ts +0 -29
- package/dist/nodes/notebook-page.d.ts.map +0 -1
- package/dist/nodes/notebook-page.js +0 -151
- package/dist/nodes/notebook-page.js.map +0 -1
- package/dist/nodes/notebook.d.ts +0 -16
- package/dist/nodes/notebook.d.ts.map +0 -1
- package/dist/nodes/notebook.js +0 -31
- package/dist/nodes/notebook.js.map +0 -1
- package/dist/nodes/overlay-child.d.ts +0 -18
- package/dist/nodes/overlay-child.d.ts.map +0 -1
- package/dist/nodes/overlay-child.js +0 -88
- package/dist/nodes/overlay-child.js.map +0 -1
- package/dist/nodes/popover-menu.d.ts +0 -19
- package/dist/nodes/popover-menu.d.ts.map +0 -1
- package/dist/nodes/popover-menu.js +0 -54
- package/dist/nodes/popover-menu.js.map +0 -1
- package/dist/nodes/scale.d.ts +0 -10
- package/dist/nodes/scale.d.ts.map +0 -1
- package/dist/nodes/scale.js +0 -19
- package/dist/nodes/scale.js.map +0 -1
- package/dist/nodes/scrolled-window.d.ts +0 -11
- package/dist/nodes/scrolled-window.d.ts.map +0 -1
- package/dist/nodes/scrolled-window.js +0 -18
- package/dist/nodes/scrolled-window.js.map +0 -1
- package/dist/nodes/search-bar.d.ts +0 -11
- package/dist/nodes/search-bar.d.ts.map +0 -1
- package/dist/nodes/search-bar.js +0 -16
- package/dist/nodes/search-bar.js.map +0 -1
- package/dist/nodes/shortcut.d.ts +0 -19
- package/dist/nodes/shortcut.d.ts.map +0 -1
- package/dist/nodes/shortcut.js +0 -72
- package/dist/nodes/shortcut.js.map +0 -1
- package/dist/nodes/slot.d.ts +0 -21
- package/dist/nodes/slot.d.ts.map +0 -1
- package/dist/nodes/slot.js +0 -102
- package/dist/nodes/slot.js.map +0 -1
- package/dist/nodes/source-view.d.ts +0 -18
- package/dist/nodes/source-view.d.ts.map +0 -1
- package/dist/nodes/source-view.js +0 -94
- package/dist/nodes/source-view.js.map +0 -1
- package/dist/nodes/stack-page.d.ts +0 -22
- package/dist/nodes/stack-page.d.ts.map +0 -1
- package/dist/nodes/stack-page.js +0 -140
- package/dist/nodes/stack-page.js.map +0 -1
- package/dist/nodes/stack.d.ts +0 -13
- package/dist/nodes/stack.d.ts.map +0 -1
- package/dist/nodes/stack.js +0 -21
- package/dist/nodes/stack.js.map +0 -1
- package/dist/nodes/text-anchor.d.ts +0 -23
- package/dist/nodes/text-anchor.d.ts.map +0 -1
- package/dist/nodes/text-anchor.js +0 -64
- package/dist/nodes/text-anchor.js.map +0 -1
- package/dist/nodes/text-content.d.ts +0 -12
- package/dist/nodes/text-content.d.ts.map +0 -1
- package/dist/nodes/text-content.js +0 -2
- package/dist/nodes/text-content.js.map +0 -1
- package/dist/nodes/text-paintable.d.ts +0 -19
- package/dist/nodes/text-paintable.d.ts.map +0 -1
- package/dist/nodes/text-paintable.js +0 -42
- package/dist/nodes/text-paintable.js.map +0 -1
- package/dist/nodes/text-segment.d.ts +0 -18
- package/dist/nodes/text-segment.d.ts.map +0 -1
- package/dist/nodes/text-segment.js +0 -38
- package/dist/nodes/text-segment.js.map +0 -1
- package/dist/nodes/text-tag.d.ts +0 -38
- package/dist/nodes/text-tag.d.ts.map +0 -1
- package/dist/nodes/text-tag.js +0 -241
- package/dist/nodes/text-tag.js.map +0 -1
- package/dist/nodes/text-view.d.ts +0 -29
- package/dist/nodes/text-view.d.ts.map +0 -1
- package/dist/nodes/text-view.js +0 -80
- package/dist/nodes/text-view.js.map +0 -1
- package/dist/nodes/toggle-group.d.ts +0 -11
- package/dist/nodes/toggle-group.d.ts.map +0 -1
- package/dist/nodes/toggle-group.js +0 -16
- package/dist/nodes/toggle-group.js.map +0 -1
- package/dist/nodes/toggle.d.ts +0 -16
- package/dist/nodes/toggle.d.ts.map +0 -1
- package/dist/nodes/toggle.js +0 -61
- package/dist/nodes/toggle.js.map +0 -1
- package/dist/nodes/virtual.d.ts +0 -7
- package/dist/nodes/virtual.d.ts.map +0 -1
- package/dist/nodes/virtual.js +0 -9
- package/dist/nodes/virtual.js.map +0 -1
- package/dist/nodes/web-view.d.ts +0 -11
- package/dist/nodes/web-view.d.ts.map +0 -1
- package/dist/nodes/web-view.js +0 -16
- package/dist/nodes/web-view.js.map +0 -1
- package/dist/nodes/widget.d.ts +0 -26
- package/dist/nodes/widget.d.ts.map +0 -1
- package/dist/nodes/widget.js +0 -315
- package/dist/nodes/widget.js.map +0 -1
- package/dist/nodes/window.d.ts +0 -31
- package/dist/nodes/window.d.ts.map +0 -1
- package/dist/nodes/window.js +0 -122
- package/dist/nodes/window.js.map +0 -1
- package/dist/portal.d.ts +0 -29
- package/dist/portal.d.ts.map +0 -1
- package/dist/portal.js +0 -35
- package/dist/portal.js.map +0 -1
- package/dist/reconciler.d.ts +0 -34
- package/dist/reconciler.d.ts.map +0 -1
- package/dist/reconciler.js +0 -48
- package/dist/reconciler.js.map +0 -1
- package/dist/registry.d.ts +0 -18
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -96
- package/dist/registry.js.map +0 -1
- package/dist/render.d.ts +0 -117
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -159
- package/dist/render.js.map +0 -1
- package/dist/types.d.ts +0 -5
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/src/components/list.tsx +0 -83
- package/src/errors.ts +0 -52
- package/src/factory.ts +0 -62
- package/src/generated/internal.ts +0 -5644
- package/src/generated/jsx.ts +0 -19900
- package/src/generated/registry.ts +0 -16
- package/src/host-config.ts +0 -219
- package/src/jsx.ts +0 -1355
- package/src/metadata.ts +0 -43
- package/src/node.ts +0 -107
- package/src/nodes/adjustable.ts +0 -68
- package/src/nodes/alert-dialog-response.ts +0 -78
- package/src/nodes/animation.ts +0 -402
- package/src/nodes/application.ts +0 -61
- package/src/nodes/calendar.ts +0 -42
- package/src/nodes/color-dialog-button.ts +0 -69
- package/src/nodes/column-view-column.ts +0 -189
- package/src/nodes/container-slot.ts +0 -87
- package/src/nodes/dialog.ts +0 -25
- package/src/nodes/drawing-area.ts +0 -62
- package/src/nodes/event-controller.ts +0 -100
- package/src/nodes/fixed-child.ts +0 -109
- package/src/nodes/font-dialog-button.ts +0 -107
- package/src/nodes/grid-child.ts +0 -103
- package/src/nodes/internal/accessible.ts +0 -155
- package/src/nodes/internal/bound-item.ts +0 -4
- package/src/nodes/internal/construct.ts +0 -60
- package/src/nodes/internal/predicates.ts +0 -80
- package/src/nodes/internal/props.ts +0 -51
- package/src/nodes/internal/signal-store.ts +0 -141
- package/src/nodes/internal/text-buffer-controller.ts +0 -417
- package/src/nodes/internal/widget.ts +0 -80
- package/src/nodes/level-bar.ts +0 -36
- package/src/nodes/list-item-node.ts +0 -29
- package/src/nodes/list.ts +0 -1082
- package/src/nodes/menu.ts +0 -27
- package/src/nodes/models/menu.ts +0 -314
- package/src/nodes/navigation-page.ts +0 -154
- package/src/nodes/navigation-view.ts +0 -66
- package/src/nodes/notebook-page-tab.ts +0 -55
- package/src/nodes/notebook-page.ts +0 -189
- package/src/nodes/notebook.ts +0 -42
- package/src/nodes/overlay-child.ts +0 -109
- package/src/nodes/popover-menu.ts +0 -67
- package/src/nodes/scale.ts +0 -28
- package/src/nodes/scrolled-window.ts +0 -23
- package/src/nodes/search-bar.ts +0 -27
- package/src/nodes/shortcut.ts +0 -86
- package/src/nodes/slot.ts +0 -138
- package/src/nodes/source-view.ts +0 -130
- package/src/nodes/stack-page.ts +0 -170
- package/src/nodes/stack.ts +0 -35
- package/src/nodes/text-anchor.ts +0 -79
- package/src/nodes/text-content.ts +0 -14
- package/src/nodes/text-paintable.ts +0 -51
- package/src/nodes/text-segment.ts +0 -55
- package/src/nodes/text-tag.ts +0 -293
- package/src/nodes/text-view.ts +0 -100
- package/src/nodes/toggle-group.ts +0 -27
- package/src/nodes/toggle.ts +0 -72
- package/src/nodes/virtual.ts +0 -16
- package/src/nodes/web-view.ts +0 -22
- package/src/nodes/widget.ts +0 -376
- package/src/nodes/window.ts +0 -172
- package/src/portal.ts +0 -37
- package/src/reconciler.ts +0 -52
- package/src/registry.ts +0 -117
- package/src/render.tsx +0 -192
- package/src/types.ts +0 -12
- /package/dist/{types.js → reconciler/types.js} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { AppliedProp, Call, ControlledTextProp, LazyProp, ListProp, ValueProp } from "@gtkx/config";
|
|
2
|
+
import type { TypedClass } from "@gtkx/runtime";
|
|
3
|
+
import { callMethod, isShallowEqual } from "@gtkx/utils";
|
|
4
|
+
import { appliedPropsFor, runCall } from "./element-props.js";
|
|
5
|
+
import type { Props } from "./types.js";
|
|
6
|
+
|
|
7
|
+
const asArray = (value: unknown): unknown[] => (Array.isArray(value) ? value : []);
|
|
8
|
+
|
|
9
|
+
const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === "object" && value !== null;
|
|
10
|
+
|
|
11
|
+
const itemsEqual = (a: unknown, b: unknown): boolean => {
|
|
12
|
+
if (a === b) return true;
|
|
13
|
+
return isRecord(a) && isRecord(b) && isShallowEqual(a, b);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const listValuesEqual = (oldValue: unknown, newValue: unknown): boolean => {
|
|
17
|
+
if (oldValue === newValue) return true;
|
|
18
|
+
const a = asArray(oldValue);
|
|
19
|
+
const b = asArray(newValue);
|
|
20
|
+
return a.length === b.length && a.every((item, index) => itemsEqual(item, b[index]));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const runAdd = (instance: object, add: Call | Call[], item: unknown): void => {
|
|
24
|
+
if (Array.isArray(add)) {
|
|
25
|
+
for (const call of add) runCall(instance, call, [item], { item });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
runCall(instance, add, [item], { item });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const snapshotItems = (items: unknown[]): unknown[] => items.map((item) => (isRecord(item) ? { ...item } : item));
|
|
32
|
+
|
|
33
|
+
const appliedLists = new WeakMap<object, Map<string, unknown[]>>();
|
|
34
|
+
|
|
35
|
+
const rememberAppliedList = (instance: object, prop: string, items: unknown[]): void => {
|
|
36
|
+
const byProp = appliedLists.get(instance) ?? new Map<string, unknown[]>();
|
|
37
|
+
byProp.set(prop, snapshotItems(items));
|
|
38
|
+
appliedLists.set(instance, byProp);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const applyList = (instance: object, prop: ListProp, newValue: unknown): void => {
|
|
42
|
+
const applied = appliedLists.get(instance)?.get(prop.prop);
|
|
43
|
+
const newItems = asArray(newValue);
|
|
44
|
+
if (applied !== undefined && listValuesEqual(applied, newItems)) return;
|
|
45
|
+
if (prop.clear !== undefined) {
|
|
46
|
+
runCall(instance, prop.clear, [], {});
|
|
47
|
+
} else if (prop.remove !== undefined) {
|
|
48
|
+
for (const item of asArray(applied)) runCall(instance, prop.remove, [item], { item });
|
|
49
|
+
} else if (asArray(applied).length !== 0) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
for (const item of newItems) runAdd(instance, prop.add, item);
|
|
53
|
+
rememberAppliedList(instance, prop.prop, newItems);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const applyValue = (instance: object, prop: ValueProp, oldValue: unknown, newValue: unknown): void => {
|
|
57
|
+
if (oldValue === newValue) return;
|
|
58
|
+
runCall(instance, prop.call, [newValue], { item: newValue });
|
|
59
|
+
if (prop.after !== undefined) callMethod(instance, prop.after, []);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const applyControlledText = (
|
|
63
|
+
instance: object,
|
|
64
|
+
prop: ControlledTextProp,
|
|
65
|
+
oldValue: unknown,
|
|
66
|
+
newValue: unknown,
|
|
67
|
+
): void => {
|
|
68
|
+
if (oldValue === newValue || typeof newValue !== "string") return;
|
|
69
|
+
if (oldValue !== undefined && Reflect.get(instance, prop.prop) !== oldValue) return;
|
|
70
|
+
Reflect.set(instance, prop.prop, newValue);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const applyLazy = (instance: object, prop: LazyProp, props: Props): void => {
|
|
74
|
+
const value = props[prop.prop];
|
|
75
|
+
if (value == null || value === "") return;
|
|
76
|
+
if (Reflect.get(instance, prop.prop) === value) return;
|
|
77
|
+
if (prop.lookup !== undefined && !callMethod(instance, prop.lookup, [value])) return;
|
|
78
|
+
Reflect.set(instance, prop.prop, value);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const applyProp = (instance: object, prop: AppliedProp, oldProps: Props | null, newProps: Props): void => {
|
|
82
|
+
const oldValue = oldProps?.[prop.prop];
|
|
83
|
+
const newValue = newProps[prop.prop];
|
|
84
|
+
switch (prop.kind) {
|
|
85
|
+
case "value":
|
|
86
|
+
applyValue(instance, prop, oldValue, newValue);
|
|
87
|
+
return;
|
|
88
|
+
case "controlled-text":
|
|
89
|
+
applyControlledText(instance, prop, oldValue, newValue);
|
|
90
|
+
return;
|
|
91
|
+
case "lazy":
|
|
92
|
+
applyLazy(instance, prop, newProps);
|
|
93
|
+
return;
|
|
94
|
+
case "list":
|
|
95
|
+
applyList(instance, prop, newValue);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const applyElementProps = (instance: TypedClass & object, oldProps: Props | null, newProps: Props): void => {
|
|
101
|
+
for (const prop of appliedPropsFor(instance.__type__).values()) {
|
|
102
|
+
applyProp(instance, prop, oldProps, newProps);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const reapplyLazyProps = (instance: TypedClass & object, props: Props): void => {
|
|
107
|
+
for (const prop of appliedPropsFor(instance.__type__).values()) {
|
|
108
|
+
if (prop.kind === "lazy") applyLazy(instance, prop, props);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/// <reference types="@gtkx/config/env" />
|
|
2
|
+
|
|
3
|
+
import { ELEMENT_PROPS } from "virtual:gtkx-config";
|
|
4
|
+
import type { AppliedProp, Arg, ArgRef, Call, ContainerProp } from "@gtkx/config";
|
|
5
|
+
import { typeFromName } from "@gtkx/gi/gobject";
|
|
6
|
+
import { callMethod } from "@gtkx/utils";
|
|
7
|
+
import { collectTypeNamesWithInterfaces, foldInheritedTableWithInterfaces } from "../utils/gtype.js";
|
|
8
|
+
|
|
9
|
+
export type CallScope = {
|
|
10
|
+
child?: unknown;
|
|
11
|
+
item?: unknown;
|
|
12
|
+
index?: number;
|
|
13
|
+
sibling?: unknown;
|
|
14
|
+
adopted?: unknown;
|
|
15
|
+
props?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const MISSING_ARG = Symbol("gtkx.missing-arg");
|
|
19
|
+
|
|
20
|
+
const fieldOf = (source: unknown, name: string): unknown =>
|
|
21
|
+
source == null ? undefined : Reflect.get(Object(source), name);
|
|
22
|
+
|
|
23
|
+
const evalArg = (arg: Arg, scope: CallScope): unknown => {
|
|
24
|
+
if (typeof arg === "string") {
|
|
25
|
+
switch (arg) {
|
|
26
|
+
case "child":
|
|
27
|
+
return scope.child;
|
|
28
|
+
case "item":
|
|
29
|
+
return scope.item;
|
|
30
|
+
case "index":
|
|
31
|
+
return scope.index;
|
|
32
|
+
case "sibling":
|
|
33
|
+
return scope.sibling;
|
|
34
|
+
case "adopted":
|
|
35
|
+
return scope.adopted;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if ("literal" in arg) return arg.literal;
|
|
39
|
+
if ("prop" in arg) {
|
|
40
|
+
const value = scope.props?.[arg.prop];
|
|
41
|
+
return value == null ? MISSING_ARG : value;
|
|
42
|
+
}
|
|
43
|
+
const value = fieldOf(scope.item, arg.field);
|
|
44
|
+
if (value == null && "or" in arg) return arg.or;
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type CallResult = {
|
|
49
|
+
called: boolean;
|
|
50
|
+
value: unknown;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const runCallValue = (target: object, call: Call, defaults: unknown[], scope: CallScope): CallResult => {
|
|
54
|
+
if (typeof call === "string") {
|
|
55
|
+
return { called: true, value: callMethod(target, call, defaults) };
|
|
56
|
+
}
|
|
57
|
+
const args = call.args.map((arg) => evalArg(arg, scope));
|
|
58
|
+
if (args.includes(MISSING_ARG)) return { called: false, value: undefined };
|
|
59
|
+
return { called: true, value: callMethod(target, call.method, args) };
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const runCall = (target: object, call: Call, defaults: unknown[], scope: CallScope): boolean =>
|
|
63
|
+
runCallValue(target, call, defaults, scope).called;
|
|
64
|
+
|
|
65
|
+
export const callUsesRef = (call: Call | undefined, ref: ArgRef): boolean =>
|
|
66
|
+
call !== undefined && typeof call !== "string" && call.args.some((arg) => arg === ref);
|
|
67
|
+
|
|
68
|
+
export const nullSetterCurrentHolder = (target: object, call: Call): unknown => {
|
|
69
|
+
if (typeof call === "string" || !call.method.startsWith("set")) return undefined;
|
|
70
|
+
if (!call.args.some((arg) => typeof arg === "object" && "literal" in arg && arg.literal === null)) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const getter = `get${call.method.slice(3)}`;
|
|
74
|
+
if (typeof Reflect.get(target, getter) !== "function") return undefined;
|
|
75
|
+
return callMethod(target, getter, []);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const attachIndex = new Map<string, ContainerProp>();
|
|
79
|
+
const adoptByParent = new Map<string, ContainerProp>();
|
|
80
|
+
const namedContainerPropsByParent: Record<string, string[]> = {};
|
|
81
|
+
const APPLIED_BY_TYPE: Record<string, AppliedProp[]> = {};
|
|
82
|
+
|
|
83
|
+
for (const [parent, props] of Object.entries(ELEMENT_PROPS)) {
|
|
84
|
+
for (const prop of props) {
|
|
85
|
+
if (prop.kind === "container") {
|
|
86
|
+
attachIndex.set(`${parent}:${prop.child}:${prop.prop === "children" ? "" : prop.prop}`, prop);
|
|
87
|
+
if (prop.prop !== "children") {
|
|
88
|
+
const propNames = namedContainerPropsByParent[parent] ?? [];
|
|
89
|
+
propNames.push(prop.prop);
|
|
90
|
+
namedContainerPropsByParent[parent] = propNames;
|
|
91
|
+
}
|
|
92
|
+
if (prop.adopt !== undefined) adoptByParent.set(parent, prop);
|
|
93
|
+
} else {
|
|
94
|
+
const applied = APPLIED_BY_TYPE[parent] ?? [];
|
|
95
|
+
applied.push(prop);
|
|
96
|
+
APPLIED_BY_TYPE[parent] = applied;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const attachCache = new Map<string, ContainerProp | null>();
|
|
102
|
+
|
|
103
|
+
export const resolveContainerProp = (
|
|
104
|
+
parentType: bigint,
|
|
105
|
+
childType: bigint,
|
|
106
|
+
propName: string | undefined,
|
|
107
|
+
): ContainerProp | null => {
|
|
108
|
+
const cacheKey = `${parentType}:${childType}:${propName ?? ""}`;
|
|
109
|
+
const cached = attachCache.get(cacheKey);
|
|
110
|
+
if (cached !== undefined) return cached;
|
|
111
|
+
let resolved: ContainerProp | null = null;
|
|
112
|
+
const parentNames = collectTypeNamesWithInterfaces(parentType);
|
|
113
|
+
for (const childName of collectTypeNamesWithInterfaces(childType)) {
|
|
114
|
+
for (const parentName of parentNames) {
|
|
115
|
+
resolved = attachIndex.get(`${parentName}:${childName}:${propName ?? ""}`) ?? null;
|
|
116
|
+
if (resolved !== null) break;
|
|
117
|
+
}
|
|
118
|
+
if (resolved !== null) break;
|
|
119
|
+
}
|
|
120
|
+
attachCache.set(cacheKey, resolved);
|
|
121
|
+
return resolved;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const adoptCache = new Map<bigint, ContainerProp | null>();
|
|
125
|
+
|
|
126
|
+
export const adoptContainerPropFor = (parentType: bigint): ContainerProp | null => {
|
|
127
|
+
const cached = adoptCache.get(parentType);
|
|
128
|
+
if (cached !== undefined) return cached;
|
|
129
|
+
let resolved: ContainerProp | null = null;
|
|
130
|
+
for (const name of collectTypeNamesWithInterfaces(parentType)) {
|
|
131
|
+
const cp = adoptByParent.get(name);
|
|
132
|
+
if (cp !== undefined) {
|
|
133
|
+
resolved = cp;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
adoptCache.set(parentType, resolved);
|
|
138
|
+
return resolved;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const containerPropNamesCache = new Map<string, Set<string>>();
|
|
142
|
+
|
|
143
|
+
export const containerPropNamesFor = (elementName: string): Set<string> => {
|
|
144
|
+
const cached = containerPropNamesCache.get(elementName);
|
|
145
|
+
if (cached) return cached;
|
|
146
|
+
const names = foldInheritedTableWithInterfaces(
|
|
147
|
+
typeFromName(elementName),
|
|
148
|
+
namedContainerPropsByParent,
|
|
149
|
+
(collected: Set<string>, propNames) => {
|
|
150
|
+
for (const name of propNames) collected.add(name);
|
|
151
|
+
return collected;
|
|
152
|
+
},
|
|
153
|
+
new Set<string>(),
|
|
154
|
+
);
|
|
155
|
+
containerPropNamesCache.set(elementName, names);
|
|
156
|
+
return names;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const appliedCache = new Map<bigint, Map<string, AppliedProp>>();
|
|
160
|
+
|
|
161
|
+
export const appliedPropsFor = (gtype: bigint): Map<string, AppliedProp> => {
|
|
162
|
+
const cached = appliedCache.get(gtype);
|
|
163
|
+
if (cached) return cached;
|
|
164
|
+
const resolved = foldInheritedTableWithInterfaces<AppliedProp[], Map<string, AppliedProp>>(
|
|
165
|
+
gtype,
|
|
166
|
+
APPLIED_BY_TYPE,
|
|
167
|
+
(collected, props) => {
|
|
168
|
+
for (const prop of props) {
|
|
169
|
+
if (!collected.has(prop.prop)) collected.set(prop.prop, prop);
|
|
170
|
+
}
|
|
171
|
+
return collected;
|
|
172
|
+
},
|
|
173
|
+
new Map(),
|
|
174
|
+
);
|
|
175
|
+
appliedCache.set(gtype, resolved);
|
|
176
|
+
return resolved;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const isAppliedProp = (gtype: bigint, name: string): boolean => appliedPropsFor(gtype).has(name);
|
|
180
|
+
|
|
181
|
+
const constructionSkipCache = new Map<bigint, Set<string>>();
|
|
182
|
+
|
|
183
|
+
export const constructionSkipProps = (gtype: bigint): Set<string> => {
|
|
184
|
+
const cached = constructionSkipCache.get(gtype);
|
|
185
|
+
if (cached) return cached;
|
|
186
|
+
const skipped = new Set<string>();
|
|
187
|
+
for (const prop of appliedPropsFor(gtype).values()) {
|
|
188
|
+
if (prop.kind === "lazy") skipped.add(prop.prop);
|
|
189
|
+
}
|
|
190
|
+
constructionSkipCache.set(gtype, skipped);
|
|
191
|
+
return skipped;
|
|
192
|
+
};
|