@gtkx/react 0.21.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 +137 -34
- 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 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- 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 -14
- 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/compound.d.ts +0 -40
- package/dist/components/compound.d.ts.map +0 -1
- package/dist/components/compound.js +0 -46
- package/dist/components/compound.js.map +0 -1
- package/dist/components/list.d.ts +0 -75
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/list.js +0 -81
- package/dist/components/list.js.map +0 -1
- package/dist/components/slot-widget.d.ts +0 -15
- package/dist/components/slot-widget.d.ts.map +0 -1
- package/dist/components/slot-widget.js +0 -37
- package/dist/components/slot-widget.js.map +0 -1
- package/dist/errors.d.ts +0 -15
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -44
- 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/compounds.d.ts +0 -2672
- package/dist/generated/compounds.d.ts.map +0 -1
- package/dist/generated/compounds.js +0 -2624
- package/dist/generated/compounds.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 -3638
- package/dist/generated/internal.js.map +0 -1
- package/dist/generated/jsx.d.ts +0 -17074
- package/dist/generated/jsx.d.ts.map +0 -1
- package/dist/generated/jsx.js +0 -6715
- package/dist/generated/jsx.js.map +0 -1
- package/dist/generated/registry.d.ts +0 -5
- package/dist/generated/registry.d.ts.map +0 -1
- package/dist/generated/registry.js +0 -13
- 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 -974
- package/dist/jsx.d.ts.map +0 -1
- package/dist/jsx.js +0 -8
- 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/alert-dialog.d.ts +0 -14
- package/dist/nodes/alert-dialog.d.ts.map +0 -1
- package/dist/nodes/alert-dialog.js +0 -41
- package/dist/nodes/alert-dialog.js.map +0 -1
- package/dist/nodes/animation.d.ts +0 -39
- package/dist/nodes/animation.d.ts.map +0 -1
- package/dist/nodes/animation.js +0 -326
- 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 -18
- package/dist/nodes/container-slot.d.ts.map +0 -1
- package/dist/nodes/container-slot.js +0 -81
- 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 -19
- package/dist/nodes/drawing-area.d.ts.map +0 -1
- package/dist/nodes/drawing-area.js +0 -40
- 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 -73
- package/dist/nodes/event-controller.js.map +0 -1
- package/dist/nodes/fixed-child.d.ts +0 -19
- package/dist/nodes/fixed-child.d.ts.map +0 -1
- package/dist/nodes/fixed-child.js +0 -99
- 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 -19
- package/dist/nodes/grid-child.d.ts.map +0 -1
- package/dist/nodes/grid-child.js +0 -94
- 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 -68
- 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 -45
- 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 -20
- package/dist/nodes/overlay-child.d.ts.map +0 -1
- package/dist/nodes/overlay-child.js +0 -109
- 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/spin-row.d.ts +0 -14
- package/dist/nodes/spin-row.d.ts.map +0 -1
- package/dist/nodes/spin-row.js +0 -46
- package/dist/nodes/spin-row.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/switch-row.d.ts +0 -11
- package/dist/nodes/switch-row.d.ts.map +0 -1
- package/dist/nodes/switch-row.js +0 -15
- package/dist/nodes/switch-row.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 -74
- 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 -247
- 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 -17
- package/dist/nodes/toggle-group.d.ts.map +0 -1
- package/dist/nodes/toggle-group.js +0 -65
- 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 -308
- 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 -98
- 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 -6
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/use-property.d.ts +0 -29
- package/dist/use-property.d.ts.map +0 -1
- package/dist/use-property.js +0 -44
- package/dist/use-property.js.map +0 -1
- package/dist/use-setting.d.ts +0 -36
- package/dist/use-setting.d.ts.map +0 -1
- package/dist/use-setting.js +0 -68
- package/dist/use-setting.js.map +0 -1
- package/src/components/compound.tsx +0 -57
- package/src/components/list.tsx +0 -140
- package/src/components/slot-widget.tsx +0 -46
- package/src/errors.ts +0 -53
- package/src/factory.ts +0 -62
- package/src/generated/compounds.ts +0 -2741
- package/src/generated/internal.ts +0 -3642
- package/src/generated/jsx.ts +0 -17383
- package/src/generated/registry.ts +0 -17
- package/src/host-config.ts +0 -219
- package/src/jsx.ts +0 -1033
- 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/alert-dialog.ts +0 -55
- package/src/nodes/animation.ts +0 -409
- 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 -100
- package/src/nodes/dialog.ts +0 -25
- package/src/nodes/drawing-area.ts +0 -53
- package/src/nodes/event-controller.ts +0 -96
- package/src/nodes/fixed-child.ts +0 -122
- package/src/nodes/font-dialog-button.ts +0 -107
- package/src/nodes/grid-child.ts +0 -116
- 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 -74
- package/src/nodes/level-bar.ts +0 -36
- package/src/nodes/list-item-node.ts +0 -53
- 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 -130
- 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/spin-row.ts +0 -72
- package/src/nodes/stack-page.ts +0 -170
- package/src/nodes/stack.ts +0 -35
- package/src/nodes/switch-row.ts +0 -26
- package/src/nodes/text-anchor.ts +0 -88
- 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 -298
- package/src/nodes/text-view.ts +0 -100
- package/src/nodes/toggle-group.ts +0 -81
- 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 -369
- package/src/nodes/window.ts +0 -172
- package/src/portal.ts +0 -37
- package/src/reconciler.ts +0 -52
- package/src/registry.ts +0 -119
- package/src/render.tsx +0 -192
- package/src/types.ts +0 -13
- package/src/use-property.ts +0 -58
- package/src/use-setting.ts +0 -96
- /package/dist/{types.js → reconciler/types.js} +0 -0
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { NotebookPageProps } from "../jsx.js";
|
|
3
|
-
import type { Node } from "../node.js";
|
|
4
|
-
import { hasChanged } from "./internal/props.js";
|
|
5
|
-
import { NotebookPageTabNode } from "./notebook-page-tab.js";
|
|
6
|
-
import { VirtualNode } from "./virtual.js";
|
|
7
|
-
import { WidgetNode } from "./widget.js";
|
|
8
|
-
|
|
9
|
-
type NotebookPageChild = WidgetNode | NotebookPageTabNode;
|
|
10
|
-
|
|
11
|
-
export class NotebookPageNode extends VirtualNode<NotebookPageProps, WidgetNode<Gtk.Notebook>, NotebookPageChild> {
|
|
12
|
-
private position: number | null = null;
|
|
13
|
-
|
|
14
|
-
public override isValidChild(child: Node): boolean {
|
|
15
|
-
return child instanceof WidgetNode || child instanceof NotebookPageTabNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public override isValidParent(parent: Node): boolean {
|
|
19
|
-
return parent instanceof WidgetNode && parent.container instanceof Gtk.Notebook;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public findTabNode(): NotebookPageTabNode | undefined {
|
|
23
|
-
return this.children.find((c): c is NotebookPageTabNode => c instanceof NotebookPageTabNode);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public findContentChild(): WidgetNode | undefined {
|
|
27
|
-
return this.children.find(
|
|
28
|
-
(c): c is WidgetNode => c instanceof WidgetNode && !(c instanceof NotebookPageTabNode),
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public override setParent(parent: WidgetNode<Gtk.Notebook> | null): void {
|
|
33
|
-
if (!parent && this.parent) {
|
|
34
|
-
const childWidget = this.findContentChild()?.container ?? null;
|
|
35
|
-
if (childWidget) {
|
|
36
|
-
this.detachPage(childWidget);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
super.setParent(parent);
|
|
41
|
-
|
|
42
|
-
if (parent && this.findContentChild()) {
|
|
43
|
-
this.onChildChange(null);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public override appendChild(child: NotebookPageChild): void {
|
|
48
|
-
if (child instanceof NotebookPageTabNode) {
|
|
49
|
-
super.appendChild(child);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const oldContent = this.findContentChild()?.container ?? null;
|
|
54
|
-
super.appendChild(child);
|
|
55
|
-
|
|
56
|
-
if (this.parent) {
|
|
57
|
-
this.onChildChange(oldContent);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public override removeChild(child: NotebookPageChild): void {
|
|
62
|
-
if (child instanceof NotebookPageTabNode) {
|
|
63
|
-
super.removeChild(child);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const isContent = child === this.findContentChild();
|
|
68
|
-
const oldContent = isContent ? child.container : null;
|
|
69
|
-
super.removeChild(child);
|
|
70
|
-
|
|
71
|
-
if (isContent && this.parent && oldContent) {
|
|
72
|
-
this.onChildChange(oldContent);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public override commitUpdate(oldProps: NotebookPageProps | null, newProps: NotebookPageProps): void {
|
|
77
|
-
super.commitUpdate(oldProps, newProps);
|
|
78
|
-
this.applyOwnProps(oldProps, newProps);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public override detachDeletedInstance(): void {
|
|
82
|
-
const childWidget = this.findContentChild()?.container ?? null;
|
|
83
|
-
if (childWidget && this.parent) {
|
|
84
|
-
const notebook = this.getParentWidget();
|
|
85
|
-
if (notebook.getNPages() <= 1) {
|
|
86
|
-
notebook.setShowTabs(false);
|
|
87
|
-
}
|
|
88
|
-
this.detachPage(childWidget);
|
|
89
|
-
}
|
|
90
|
-
super.detachDeletedInstance();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public setPosition(position: number | null): void {
|
|
94
|
-
this.position = position;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public getChildWidget(): Gtk.Widget {
|
|
98
|
-
const contentChild = this.findContentChild();
|
|
99
|
-
if (!contentChild) {
|
|
100
|
-
throw new Error("Expected content child widget to be set on NotebookPageNode");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return contentChild.container;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
private getParentWidget(): Gtk.Notebook {
|
|
107
|
-
if (!this.parent) {
|
|
108
|
-
throw new Error("Expected parent widget to be set on NotebookPageNode");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return this.parent.container;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private applyOwnProps(oldProps: NotebookPageProps | null, newProps: NotebookPageProps): void {
|
|
115
|
-
const contentChild = this.findContentChild();
|
|
116
|
-
const childWidget = contentChild?.container ?? null;
|
|
117
|
-
const tabNode = this.findTabNode();
|
|
118
|
-
|
|
119
|
-
if (hasChanged(oldProps, newProps, "label") && childWidget && this.parent && !tabNode?.children[0]) {
|
|
120
|
-
const tabLabel = this.getParentWidget().getTabLabel(childWidget) as Gtk.Label;
|
|
121
|
-
tabLabel.setLabel(newProps.label ?? "");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const pagePropsChanged =
|
|
125
|
-
hasChanged(oldProps, newProps, "tabExpand") || hasChanged(oldProps, newProps, "tabFill");
|
|
126
|
-
if (childWidget && this.parent && pagePropsChanged) {
|
|
127
|
-
this.applyPageProps();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
private attachPage(): void {
|
|
132
|
-
const child = this.getChildWidget();
|
|
133
|
-
const notebook = this.getParentWidget();
|
|
134
|
-
const tabNode = this.findTabNode();
|
|
135
|
-
|
|
136
|
-
let tabLabel: Gtk.Widget;
|
|
137
|
-
|
|
138
|
-
if (tabNode?.children[0]) {
|
|
139
|
-
tabLabel = tabNode.children[0].container;
|
|
140
|
-
} else {
|
|
141
|
-
const label = new Gtk.Label();
|
|
142
|
-
label.setLabel(this.props.label ?? "");
|
|
143
|
-
tabLabel = label;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (this.position != null) {
|
|
147
|
-
notebook.insertPage(child, this.position, tabLabel);
|
|
148
|
-
} else {
|
|
149
|
-
notebook.appendPage(child, tabLabel);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
this.applyPageProps();
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
private applyPageProps(): void {
|
|
156
|
-
const child = this.findContentChild()?.container ?? null;
|
|
157
|
-
if (!child || !this.parent) return;
|
|
158
|
-
|
|
159
|
-
const notebook = this.getParentWidget();
|
|
160
|
-
const page = notebook.getPage(child);
|
|
161
|
-
if (!page) return;
|
|
162
|
-
|
|
163
|
-
if (this.props.tabExpand !== undefined) {
|
|
164
|
-
page.tabExpand = this.props.tabExpand;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (this.props.tabFill !== undefined) {
|
|
168
|
-
page.tabFill = this.props.tabFill;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
private detachPage(childToDetach: Gtk.Widget): void {
|
|
173
|
-
const notebook = this.getParentWidget();
|
|
174
|
-
const pageNum = notebook.pageNum(childToDetach);
|
|
175
|
-
if (pageNum !== -1) {
|
|
176
|
-
notebook.removePage(pageNum);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
private onChildChange(oldChild: Gtk.Widget | null): void {
|
|
181
|
-
if (oldChild) {
|
|
182
|
-
this.detachPage(oldChild);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (this.findContentChild()) {
|
|
186
|
-
this.attachPage();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
package/src/nodes/notebook.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { Node } from "../node.js";
|
|
3
|
-
import type { Props } from "../types.js";
|
|
4
|
-
import { ContainerSlotNode } from "./container-slot.js";
|
|
5
|
-
import { EventControllerNode } from "./event-controller.js";
|
|
6
|
-
import { NotebookPageNode } from "./notebook-page.js";
|
|
7
|
-
import { SlotNode } from "./slot.js";
|
|
8
|
-
import { WidgetNode } from "./widget.js";
|
|
9
|
-
|
|
10
|
-
type NotebookChild = NotebookPageNode | EventControllerNode | SlotNode | ContainerSlotNode;
|
|
11
|
-
|
|
12
|
-
export class NotebookNode extends WidgetNode<Gtk.Notebook, Props, NotebookChild> {
|
|
13
|
-
public override isValidChild(child: Node): boolean {
|
|
14
|
-
return (
|
|
15
|
-
child instanceof NotebookPageNode ||
|
|
16
|
-
child instanceof EventControllerNode ||
|
|
17
|
-
child instanceof SlotNode ||
|
|
18
|
-
child instanceof ContainerSlotNode
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public override insertBefore(child: NotebookChild, before: NotebookChild): void {
|
|
23
|
-
if (child instanceof NotebookPageNode && before instanceof NotebookPageNode) {
|
|
24
|
-
const isMove = this.children.includes(child);
|
|
25
|
-
const beforePosition = this.container.pageNum(before.getChildWidget());
|
|
26
|
-
child.setPosition(beforePosition);
|
|
27
|
-
|
|
28
|
-
if (isMove) {
|
|
29
|
-
this.container.reorderChild(child.getChildWidget(), beforePosition);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
super.insertBefore(child, before);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public override removeChild(child: NotebookChild): void {
|
|
37
|
-
if (child instanceof NotebookPageNode) {
|
|
38
|
-
child.setPosition(null);
|
|
39
|
-
}
|
|
40
|
-
super.removeChild(child);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { OverlayChildProps } from "../jsx.js";
|
|
3
|
-
import type { Node } from "../node.js";
|
|
4
|
-
import { isRemovable } from "./internal/predicates.js";
|
|
5
|
-
import { hasChanged } from "./internal/props.js";
|
|
6
|
-
import { VirtualNode } from "./virtual.js";
|
|
7
|
-
import { WidgetNode } from "./widget.js";
|
|
8
|
-
|
|
9
|
-
export class OverlayChildNode extends VirtualNode<OverlayChildProps, WidgetNode<Gtk.Overlay>, WidgetNode> {
|
|
10
|
-
public override isValidChild(child: Node): boolean {
|
|
11
|
-
return child instanceof WidgetNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public override isValidParent(parent: Node): boolean {
|
|
15
|
-
return parent instanceof WidgetNode && parent.container instanceof Gtk.Overlay;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public override setParent(parent: WidgetNode<Gtk.Overlay> | null): void {
|
|
19
|
-
if (!parent && this.parent) {
|
|
20
|
-
this.detachAllChildren(this.parent.container);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
super.setParent(parent);
|
|
24
|
-
|
|
25
|
-
if (parent) {
|
|
26
|
-
for (const child of this.children) {
|
|
27
|
-
this.attachToParent(parent.container, child.container);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public override appendChild(child: WidgetNode): void {
|
|
33
|
-
super.appendChild(child);
|
|
34
|
-
|
|
35
|
-
if (this.parent) {
|
|
36
|
-
this.detachFromGtkParent(child);
|
|
37
|
-
this.attachToParent(this.parent.container, child.container);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public override insertBefore(child: WidgetNode, before: WidgetNode): void {
|
|
42
|
-
super.insertBefore(child, before);
|
|
43
|
-
|
|
44
|
-
if (this.parent) {
|
|
45
|
-
this.reinsertAllChildren();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public override removeChild(child: WidgetNode): void {
|
|
50
|
-
this.detachFromGtkParent(child);
|
|
51
|
-
super.removeChild(child);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public override commitUpdate(oldProps: OverlayChildProps | null, newProps: OverlayChildProps): void {
|
|
55
|
-
super.commitUpdate(oldProps, newProps);
|
|
56
|
-
|
|
57
|
-
if (!this.parent) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const measureChanged = hasChanged(oldProps, newProps, "measure");
|
|
62
|
-
const clipOverlayChanged = hasChanged(oldProps, newProps, "clipOverlay");
|
|
63
|
-
|
|
64
|
-
if (measureChanged || clipOverlayChanged) {
|
|
65
|
-
const parent = this.parent.container;
|
|
66
|
-
for (const child of this.children) {
|
|
67
|
-
if (measureChanged) {
|
|
68
|
-
parent.setMeasureOverlay(child.container, newProps.measure ?? false);
|
|
69
|
-
}
|
|
70
|
-
if (clipOverlayChanged) {
|
|
71
|
-
parent.setClipOverlay(child.container, newProps.clipOverlay ?? false);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public override detachDeletedInstance(): void {
|
|
78
|
-
if (this.parent) {
|
|
79
|
-
this.detachAllChildren(this.parent.container);
|
|
80
|
-
}
|
|
81
|
-
super.detachDeletedInstance();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
private attachToParent(parent: Gtk.Overlay, child: Gtk.Widget): void {
|
|
85
|
-
parent.addOverlay(child);
|
|
86
|
-
|
|
87
|
-
if (this.props.measure !== undefined) {
|
|
88
|
-
parent.setMeasureOverlay(child, this.props.measure);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (this.props.clipOverlay !== undefined) {
|
|
92
|
-
parent.setClipOverlay(child, this.props.clipOverlay);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
private detachFromGtkParent(child: WidgetNode): void {
|
|
97
|
-
const currentParent = child.container.getParent();
|
|
98
|
-
if (currentParent !== null) {
|
|
99
|
-
if (currentParent instanceof Gtk.Overlay) {
|
|
100
|
-
currentParent.removeOverlay(child.container);
|
|
101
|
-
} else if (isRemovable(currentParent)) {
|
|
102
|
-
currentParent.remove(child.container);
|
|
103
|
-
} else {
|
|
104
|
-
child.container.unparent();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
private reinsertAllChildren(): void {
|
|
110
|
-
if (!this.parent) return;
|
|
111
|
-
const parent = this.parent.container;
|
|
112
|
-
|
|
113
|
-
for (const child of this.children) {
|
|
114
|
-
this.detachFromGtkParent(child);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
for (const child of this.children) {
|
|
118
|
-
this.attachToParent(parent, child.container);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
private detachAllChildren(parent: Gtk.Overlay): void {
|
|
123
|
-
for (const child of this.children) {
|
|
124
|
-
const currentParent = child.container.getParent();
|
|
125
|
-
if (currentParent && currentParent === parent) {
|
|
126
|
-
parent.removeOverlay(child.container);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as Gio from "@gtkx/ffi/gio";
|
|
2
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
3
|
-
import type { Node } from "../node.js";
|
|
4
|
-
import type { PopoverMenuWidget } from "../registry.js";
|
|
5
|
-
import type { Container, Props } from "../types.js";
|
|
6
|
-
import { ContainerSlotNode } from "./container-slot.js";
|
|
7
|
-
import { EventControllerNode } from "./event-controller.js";
|
|
8
|
-
import { MenuNode } from "./menu.js";
|
|
9
|
-
import { MenuModel } from "./models/menu.js";
|
|
10
|
-
import { SlotNode } from "./slot.js";
|
|
11
|
-
import { WidgetNode } from "./widget.js";
|
|
12
|
-
|
|
13
|
-
type PopoverMenuChild = MenuNode | SlotNode | ContainerSlotNode | EventControllerNode | WidgetNode;
|
|
14
|
-
|
|
15
|
-
export class PopoverMenuNode extends WidgetNode<PopoverMenuWidget, Props, PopoverMenuChild> {
|
|
16
|
-
private menu: MenuModel;
|
|
17
|
-
|
|
18
|
-
public override isValidChild(child: Node): boolean {
|
|
19
|
-
return (
|
|
20
|
-
child instanceof MenuNode ||
|
|
21
|
-
child instanceof SlotNode ||
|
|
22
|
-
child instanceof EventControllerNode ||
|
|
23
|
-
child instanceof ContainerSlotNode ||
|
|
24
|
-
child instanceof WidgetNode
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
constructor(typeName: string, props: Props, container: PopoverMenuWidget, rootContainer: Container) {
|
|
29
|
-
super(typeName, props, container, rootContainer);
|
|
30
|
-
|
|
31
|
-
const application = rootContainer instanceof Gtk.Application ? rootContainer : undefined;
|
|
32
|
-
const actionGroup = new Gio.SimpleActionGroup();
|
|
33
|
-
const prefix = application ? "app" : "menu";
|
|
34
|
-
|
|
35
|
-
this.container.insertActionGroup(prefix, actionGroup);
|
|
36
|
-
this.menu = new MenuModel("root", {}, rootContainer, actionGroup, application);
|
|
37
|
-
this.container.setMenuModel(this.menu.getMenu());
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public override appendChild(child: PopoverMenuChild): void {
|
|
41
|
-
if (child instanceof MenuNode) {
|
|
42
|
-
this.menu.appendChild(child);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
super.appendChild(child);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public override insertBefore(child: PopoverMenuChild, before: PopoverMenuChild): void {
|
|
49
|
-
if (child instanceof MenuNode) {
|
|
50
|
-
if (before instanceof MenuNode) {
|
|
51
|
-
this.menu.insertBefore(child, before);
|
|
52
|
-
} else {
|
|
53
|
-
this.menu.appendChild(child);
|
|
54
|
-
}
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
super.insertBefore(child, before);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public override removeChild(child: PopoverMenuChild): void {
|
|
61
|
-
if (child instanceof MenuNode) {
|
|
62
|
-
this.menu.removeChild(child);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
super.removeChild(child);
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/nodes/scale.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { AdjustableProps, GtkScaleProps, ScaleMark } from "../jsx.js";
|
|
3
|
-
import { AdjustableNode } from "./adjustable.js";
|
|
4
|
-
import { shallowArrayEqual } from "./internal/props.js";
|
|
5
|
-
|
|
6
|
-
type ScaleProps = AdjustableProps & Pick<GtkScaleProps, "marks">;
|
|
7
|
-
|
|
8
|
-
export class ScaleNode extends AdjustableNode<Gtk.Scale> {
|
|
9
|
-
private appliedMarks: ScaleMark[] = [];
|
|
10
|
-
|
|
11
|
-
protected override applyOwnProps(oldProps: ScaleProps | null, newProps: ScaleProps): void {
|
|
12
|
-
super.applyOwnProps(oldProps, newProps);
|
|
13
|
-
|
|
14
|
-
const newMarks = newProps.marks ?? [];
|
|
15
|
-
|
|
16
|
-
if (shallowArrayEqual(this.appliedMarks, newMarks)) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
this.container.clearMarks();
|
|
21
|
-
|
|
22
|
-
for (const mark of newMarks) {
|
|
23
|
-
this.container.addMark(mark.value, mark.position ?? Gtk.PositionType.BOTTOM, mark.label);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
this.appliedMarks = [...newMarks];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { GtkScrolledWindowProps } from "../jsx.js";
|
|
3
|
-
import { filterProps, hasChanged } from "./internal/props.js";
|
|
4
|
-
import { WidgetNode } from "./widget.js";
|
|
5
|
-
|
|
6
|
-
const OWN_PROPS = ["hscrollbarPolicy", "vscrollbarPolicy"] as const;
|
|
7
|
-
|
|
8
|
-
type ScrolledWindowProps = Pick<GtkScrolledWindowProps, (typeof OWN_PROPS)[number]>;
|
|
9
|
-
|
|
10
|
-
export class ScrolledWindowNode extends WidgetNode<Gtk.ScrolledWindow, ScrolledWindowProps> {
|
|
11
|
-
public override commitUpdate(oldProps: ScrolledWindowProps | null, newProps: ScrolledWindowProps): void {
|
|
12
|
-
super.commitUpdate(oldProps ? filterProps(oldProps, OWN_PROPS) : null, filterProps(newProps, OWN_PROPS));
|
|
13
|
-
this.applyOwnProps(oldProps, newProps);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
private applyOwnProps(oldProps: ScrolledWindowProps | null, newProps: ScrolledWindowProps): void {
|
|
17
|
-
if (hasChanged(oldProps, newProps, "hscrollbarPolicy") || hasChanged(oldProps, newProps, "vscrollbarPolicy")) {
|
|
18
|
-
const hPolicy = newProps.hscrollbarPolicy ?? Gtk.PolicyType.AUTOMATIC;
|
|
19
|
-
const vPolicy = newProps.vscrollbarPolicy ?? Gtk.PolicyType.AUTOMATIC;
|
|
20
|
-
this.container.setPolicy(hPolicy, vPolicy);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
package/src/nodes/search-bar.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { GtkSearchBarProps } from "../jsx.js";
|
|
3
|
-
import { filterProps, hasChanged } from "./internal/props.js";
|
|
4
|
-
import { WidgetNode } from "./widget.js";
|
|
5
|
-
|
|
6
|
-
const OWN_PROPS = ["onSearchModeChanged"] as const;
|
|
7
|
-
|
|
8
|
-
type SearchBarProps = Pick<GtkSearchBarProps, (typeof OWN_PROPS)[number]>;
|
|
9
|
-
|
|
10
|
-
export class SearchBarNode extends WidgetNode<Gtk.SearchBar, SearchBarProps> {
|
|
11
|
-
public override commitUpdate(oldProps: SearchBarProps | null, newProps: SearchBarProps): void {
|
|
12
|
-
super.commitUpdate(oldProps ? filterProps(oldProps, OWN_PROPS) : null, filterProps(newProps, OWN_PROPS));
|
|
13
|
-
this.applyOwnProps(oldProps, newProps);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
private applyOwnProps(oldProps: SearchBarProps | null, newProps: SearchBarProps): void {
|
|
17
|
-
if (hasChanged(oldProps, newProps, "onSearchModeChanged")) {
|
|
18
|
-
const callback = newProps.onSearchModeChanged;
|
|
19
|
-
this.signalStore.set(
|
|
20
|
-
this,
|
|
21
|
-
this.container,
|
|
22
|
-
"notify::search-mode-enabled",
|
|
23
|
-
callback ? () => callback(this.container.getSearchMode()) : undefined,
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/nodes/shortcut.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { ShortcutProps } from "../jsx.js";
|
|
3
|
-
import type { Node } from "../node.js";
|
|
4
|
-
import { EventControllerNode } from "./event-controller.js";
|
|
5
|
-
import { hasChanged } from "./internal/props.js";
|
|
6
|
-
import { VirtualNode } from "./virtual.js";
|
|
7
|
-
|
|
8
|
-
export class ShortcutNode extends VirtualNode<ShortcutProps, EventControllerNode<Gtk.ShortcutController>, never> {
|
|
9
|
-
public override isValidChild(_child: Node): boolean {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public override isValidParent(parent: Node): boolean {
|
|
14
|
-
return parent instanceof EventControllerNode && parent.container instanceof Gtk.ShortcutController;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private shortcut: Gtk.Shortcut | null = null;
|
|
18
|
-
private action: Gtk.CallbackAction | null = null;
|
|
19
|
-
|
|
20
|
-
public override setParent(parent: EventControllerNode<Gtk.ShortcutController> | null): void {
|
|
21
|
-
if (!parent && this.parent) {
|
|
22
|
-
this.removeFromController();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
super.setParent(parent);
|
|
26
|
-
|
|
27
|
-
if (parent && !this.shortcut) {
|
|
28
|
-
this.createShortcut();
|
|
29
|
-
const shortcut = this.shortcut;
|
|
30
|
-
if (shortcut) parent.container.addShortcut(shortcut);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public override commitUpdate(oldProps: ShortcutProps | null, newProps: ShortcutProps): void {
|
|
35
|
-
super.commitUpdate(oldProps, newProps);
|
|
36
|
-
this.applyOwnProps(oldProps, newProps);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public override detachDeletedInstance(): void {
|
|
40
|
-
this.removeFromController();
|
|
41
|
-
super.detachDeletedInstance();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private removeFromController(): void {
|
|
45
|
-
if (!this.parent || !this.shortcut) return;
|
|
46
|
-
this.parent.container.removeShortcut(this.shortcut);
|
|
47
|
-
this.shortcut = null;
|
|
48
|
-
this.action = null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private createShortcut(): void {
|
|
52
|
-
const trigger = this.createTrigger();
|
|
53
|
-
this.action = new Gtk.CallbackAction(() => {
|
|
54
|
-
const result = this.props.onActivate();
|
|
55
|
-
return result !== false;
|
|
56
|
-
});
|
|
57
|
-
this.shortcut = new Gtk.Shortcut(trigger, this.action);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
private applyOwnProps(oldProps: ShortcutProps | null, newProps: ShortcutProps): void {
|
|
61
|
-
if (!this.shortcut) return;
|
|
62
|
-
|
|
63
|
-
if (hasChanged(oldProps, newProps, "trigger") || hasChanged(oldProps, newProps, "disabled")) {
|
|
64
|
-
this.shortcut.setTrigger(this.createTrigger());
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private createTrigger(): Gtk.ShortcutTrigger {
|
|
69
|
-
if (this.props.disabled) {
|
|
70
|
-
return Gtk.NeverTrigger.get();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const { trigger } = this.props;
|
|
74
|
-
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
75
|
-
|
|
76
|
-
if (triggers.length === 0) {
|
|
77
|
-
return Gtk.NeverTrigger.get();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let result: Gtk.ShortcutTrigger = new Gtk.ShortcutTrigger(triggers[0] as string);
|
|
81
|
-
for (let i = 1; i < triggers.length; i++) {
|
|
82
|
-
result = new Gtk.AlternativeTrigger(result, new Gtk.ShortcutTrigger(triggers[i] as string));
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
}
|