@gtkx/react 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/element-behaviors.js +40 -1
- package/dist/element-behaviors.js.map +1 -1
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/prop-types.d.ts +12 -2
- package/dist/prop-types.d.ts.map +1 -1
- package/dist/prop-types.js.map +1 -1
- package/dist/reconciler/apply-props.d.ts.map +1 -1
- package/dist/reconciler/apply-props.js +2 -1
- package/dist/reconciler/apply-props.js.map +1 -1
- package/dist/reconciler/host-config.d.ts.map +1 -1
- package/dist/reconciler/host-config.js +8 -1
- package/dist/reconciler/host-config.js.map +1 -1
- package/dist/reconciler/style.d.ts +6 -0
- package/dist/reconciler/style.d.ts.map +1 -0
- package/dist/reconciler/style.js +60 -0
- package/dist/reconciler/style.js.map +1 -0
- package/dist/utils/accessible-props.d.ts.map +1 -1
- package/dist/utils/accessible-props.js +13 -7
- package/dist/utils/accessible-props.js.map +1 -1
- package/package.json +5 -4
- package/src/element-behaviors.ts +61 -1
- package/src/internal.ts +2 -0
- package/src/prop-types.ts +86 -1
- package/src/reconciler/apply-props.ts +2 -1
- package/src/reconciler/host-config.ts +10 -1
- package/src/reconciler/style.ts +83 -0
- package/src/utils/accessible-props.ts +15 -7
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ GTK4 is mature, and GtkBuilder XML can lay out a static interface, but nothing r
|
|
|
98
98
|
- a React reconciler that exposes every GObject as a JSX element,
|
|
99
99
|
- a CLI for scaffolding, development, and production builds,
|
|
100
100
|
- a dev server with Fast Refresh that patches your running UI in place,
|
|
101
|
-
- CSS-in-JS styling and high-level list, grid, and dialog components,
|
|
101
|
+
- CSS-in-JS styling, React Spring animations, and high-level list, grid, and dialog components,
|
|
102
102
|
- a Testing Library-style API for querying and driving your widgets in tests,
|
|
103
103
|
- and a Model Context Protocol (MCP) server that exposes your live app to AI agents.
|
|
104
104
|
|
|
@@ -157,6 +157,7 @@ Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
|
|
|
157
157
|
- [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the counter above.
|
|
158
158
|
- [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo): a React port of the official GTK4 widget showcase, covering lists, dialogs, gestures, CSS, and OpenGL.
|
|
159
159
|
- [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser): a WebKitWebView-based web browser.
|
|
160
|
+
- [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations): a tour of `@gtkx/animated`, React Spring animations driven by the GTK frame clock.
|
|
160
161
|
- [`tutorial`](https://github.com/gtkx-org/gtkx/tree/main/examples/tutorial): the Tasks app the documentation builds.
|
|
161
162
|
|
|
162
163
|
## Status
|
|
@@ -3,7 +3,9 @@ import * as GLib from "@gtkx/gi/glib";
|
|
|
3
3
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
4
4
|
import { BUILTIN_ELEMENTS, SINGLE_CHILD_TYPES } from "./element-config.js";
|
|
5
5
|
import { addRemoveSlot, adoptedChildrenSlot, applicationCreator, boxSlot, childSetterSlot, controlledText, deferred, list, slot, value, wrappingIndexedSlot, } from "./reconciler/behaviors.js";
|
|
6
|
-
import { forTypes, registerElements } from "./reconciler/registry.js";
|
|
6
|
+
import { forTypes, registerElements, } from "./reconciler/registry.js";
|
|
7
|
+
import { applyWrite } from "./reconciler/signals.js";
|
|
8
|
+
import { applyStyle, styleClass } from "./reconciler/style.js";
|
|
7
9
|
const BUILTIN_BEHAVIORS = {
|
|
8
10
|
...forTypes(SINGLE_CHILD_TYPES, {
|
|
9
11
|
behaviors: [childSetterSlot()],
|
|
@@ -56,6 +58,7 @@ const BUILTIN_BEHAVIORS = {
|
|
|
56
58
|
widget.insertActionGroup(info.props.prefix ?? "", null);
|
|
57
59
|
},
|
|
58
60
|
}),
|
|
61
|
+
styleBehavior(),
|
|
59
62
|
],
|
|
60
63
|
},
|
|
61
64
|
GtkBox: {
|
|
@@ -330,6 +333,42 @@ const BUILTIN_BEHAVIORS = {
|
|
|
330
333
|
function layoutChild(parent, child) {
|
|
331
334
|
return parent.getLayoutManager()?.getLayoutChild(child) ?? null;
|
|
332
335
|
}
|
|
336
|
+
const isNullish = (value) => value === undefined || value === null;
|
|
337
|
+
const isInitialNull = (prevValue, value) => value === null && prevValue === undefined;
|
|
338
|
+
const withStyleClass = (classes, className) => Array.isArray(classes) ? [...classes, className] : [className];
|
|
339
|
+
const hasCssClassesChange = (prev, next) => {
|
|
340
|
+
const classes = next.cssClasses;
|
|
341
|
+
if (classes === undefined || Object.is(prev.cssClasses, classes)) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
return !isInitialNull(prev.cssClasses, classes);
|
|
345
|
+
};
|
|
346
|
+
const didWriteCssClasses = (widget, prev, next, className) => {
|
|
347
|
+
if (className === null || !hasCssClassesChange(prev, next)) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
applyWrite(() => {
|
|
351
|
+
Reflect.set(widget, "cssClasses", withStyleClass(next.cssClasses, className));
|
|
352
|
+
});
|
|
353
|
+
return true;
|
|
354
|
+
};
|
|
355
|
+
const isRestyled = (prev, next) => {
|
|
356
|
+
if (isNullish(prev.style) && isNullish(next.style)) {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
return !Object.is(prev.style, next.style);
|
|
360
|
+
};
|
|
361
|
+
function updateStyle(widget, prev, next) {
|
|
362
|
+
const isChanged = isRestyled(prev, next);
|
|
363
|
+
const className = isChanged ? applyStyle(widget, next.style) : styleClass(widget);
|
|
364
|
+
if (!isChanged && className === null) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
return didWriteCssClasses(widget, prev, next, className) ? ["style", "cssClasses"] : ["style"];
|
|
368
|
+
}
|
|
369
|
+
function styleBehavior() {
|
|
370
|
+
return { update: updateStyle };
|
|
371
|
+
}
|
|
333
372
|
const addMainOption = (application, option) => {
|
|
334
373
|
application.addMainOption(option.longName, option.shortName?.codePointAt(0) ?? 0, option.flags ?? GLib.OptionFlags.NONE, option.arg ?? GLib.OptionArg.NONE, option.description, option.argDescription ?? null);
|
|
335
374
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-behaviors.js","sourceRoot":"","sources":["../src/element-behaviors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAWpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,mBAAmB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAsB,QAAQ,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,MAAM,iBAAiB,GAAyC;IAC5D,GAAG,QAAQ,CAAC,kBAAkB,EAAE;QAC5B,SAAS,EAAE,CAAC,eAAe,EAAE,CAAC;KACjC,CAAC;IACF,GAAG,QAAQ,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE;QAC1C,SAAS,EAAE;YACP,aAAa,CACT,OAAO,EACP,WAAW,EACX,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;gBACX,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC,EACD,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,CACJ;YACD,aAAa,CACT,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AAI,CAAC;AAChB,CAAC,CAAC;AAEF,SAAS,cAAc,CAAC,IAAc,EAAE,IAAc;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;IAEjC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACnC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gio from \"@gtkx/gi/gio\";\nimport * as GLib from \"@gtkx/gi/glib\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n ActionAccel,\n CreditSection,\n DragSourceIcon,\n LevelBarOffset,\n MainOption,\n MenuItem,\n ScaleMark,\n VflConstraints,\n} from \"./prop-types.js\";\nimport { BUILTIN_ELEMENTS, SINGLE_CHILD_TYPES } from \"./element-config.js\";\nimport {\n addRemoveSlot,\n adoptedChildrenSlot,\n applicationCreator,\n boxSlot,\n childSetterSlot,\n controlledText,\n deferred,\n list,\n slot,\n value,\n wrappingIndexedSlot,\n} from \"./reconciler/behaviors.js\";\nimport { type ElementConfig, forTypes, registerElements } from \"./reconciler/registry.js\";\n\nconst BUILTIN_BEHAVIORS: Record<string, ElementConfig<never>> = {\n ...forTypes(SINGLE_CHILD_TYPES, {\n behaviors: [childSetterSlot()],\n }),\n ...forTypes([\"GtkHeaderBar\", \"GtkActionBar\"], {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"start\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packStart(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"end\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packEnd(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n ],\n }),\n GtkWindow: {\n behaviors: [childSetterSlot()],\n },\n GtkWidget: {\n behaviors: [\n slot<Gtk.Widget, Gtk.Popover>(\"children\", \"GtkPopover\", {\n attach: (parent, popover) => {\n popover.setParent(parent);\n },\n detach: (_parent, popover) => {\n popover.unparent();\n },\n }),\n addRemoveSlot<Gtk.EventController, Gtk.Widget>(\n \"controllers\",\n \"GtkEventController\",\n (widget, controller) => {\n widget.addController(controller);\n },\n (widget, controller) => {\n widget.removeController(controller);\n },\n ),\n slot<Gtk.Widget, Gtk.LayoutManager>(\"layoutManager\", \"GtkLayoutManager\", {\n attach: (widget, manager) => {\n widget.setLayoutManager(manager);\n },\n detach: (widget) => {\n widget.setLayoutManager(null);\n },\n }),\n slot<Gtk.Widget, Gio.ActionGroup>(\"actionGroups\", \"GActionGroup\", {\n attach: (widget, group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", group);\n },\n detach: (widget, _group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", null);\n },\n }),\n ],\n },\n GtkBox: {\n behaviors: [boxSlot<Gtk.Box>()],\n },\n GtkListBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.ListBoxRow, (row, inner) => {\n row.setChild(inner);\n }),\n ],\n },\n GtkFlowBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.FlowBoxChild, (child, inner) => {\n child.setChild(inner);\n }),\n ],\n },\n GtkOverlay: {\n behaviors: [\n childSetterSlot<Gtk.Overlay>(),\n slot<Gtk.Overlay, Gtk.Widget>(\"overlays\", \"GtkWidget\", {\n attach: (overlay, child) => {\n overlay.addOverlay(child);\n },\n detach: (overlay, child) => {\n overlay.removeOverlay(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkShortcutController: {\n behaviors: [\n addRemoveSlot<Gtk.Shortcut, Gtk.ShortcutController>(\n \"shortcuts\",\n \"GtkShortcut\",\n (controller, shortcut) => {\n controller.addShortcut(shortcut);\n },\n (controller, shortcut) => {\n controller.removeShortcut(shortcut);\n },\n ),\n ],\n },\n GtkTextChildAnchor: {\n behaviors: [{ create: () => Gtk.TextChildAnchor.new() }],\n },\n GtkTextView: {\n behaviors: [\n slot<Gtk.TextView, Gtk.TextBuffer>(\"children\", \"GtkTextBuffer\", {\n attach: (view, buffer) => {\n view.setBuffer(buffer);\n },\n detach: (view) => {\n view.setBuffer(null);\n },\n }),\n ],\n },\n GActionMap: {\n behaviors: [\n slot<Gio.ActionMap, Gio.Action>(\"actions\", \"GAction\", {\n attach: (map, action) => {\n map.addAction(action);\n },\n detach: (map, _action, info) => {\n map.removeAction((info.props.name as string | null) ?? \"\");\n },\n }),\n ],\n },\n GMenu: {\n behaviors: [\n list<Gio.Menu, MenuItem>(\"items\", {\n clear: (menu) => {\n menu.removeAll();\n },\n add: (menu, item) => {\n appendMenuItem(menu, item);\n },\n }),\n ],\n },\n GtkColumnView: {\n behaviors: [\n slot<Gtk.ColumnView, Gtk.ColumnViewColumn>(\"children\", \"GtkColumnViewColumn\", {\n attach: (view, column, info) => {\n view.insertColumn(info.index, column);\n },\n detach: (view, column) => {\n view.removeColumn(column);\n },\n }),\n ],\n },\n GtkGrid: {\n behaviors: [\n slot<Gtk.Grid, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (grid, child) => {\n grid.attach(child, 0, 0, 1, 1);\n },\n detach: (grid, child) => {\n grid.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkFixed: {\n behaviors: [\n slot<Gtk.Fixed, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (fixed, child) => {\n fixed.put(child, 0, 0);\n },\n detach: (fixed, child) => {\n fixed.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkSizeGroup: {\n behaviors: [\n list<Gtk.SizeGroup, Gtk.Widget>(\"widgets\", {\n add: (group, widget) => {\n group.addWidget(widget);\n },\n remove: (group, widget) => {\n group.removeWidget(widget);\n },\n }),\n ],\n },\n GtkConstraintLayout: {\n behaviors: [\n addRemoveSlot<Gtk.Constraint, Gtk.ConstraintLayout>(\n \"constraints\",\n \"GtkConstraint\",\n (layout, constraint) => {\n layout.addConstraint(constraint);\n },\n (layout, constraint) => {\n layout.removeConstraint(constraint);\n },\n ),\n addRemoveSlot<Gtk.ConstraintGuide, Gtk.ConstraintLayout>(\n \"guides\",\n \"GtkConstraintGuide\",\n (layout, guide) => {\n layout.addGuide(guide);\n },\n (layout, guide) => {\n layout.removeGuide(guide);\n },\n ),\n list<Gtk.ConstraintLayout, VflConstraints, Gtk.Constraint[]>(\"vfl\", {\n add: (layout, item) => [\n ...layout.addConstraintsFromDescription(\n item.lines,\n item.hspacing ?? 0,\n item.vspacing ?? 0,\n item.views ?? new Map<string, Gtk.ConstraintTarget>(),\n ),\n ],\n remove: (layout, _item, constraints) => {\n for (const constraint of constraints) {\n layout.removeConstraint(constraint);\n }\n },\n }),\n ],\n },\n GtkStack: {\n behaviors: [\n adoptedChildrenSlot<Gtk.Stack, Gtk.Widget>(\n \"GtkWidget\",\n (stack, child) => stack.addChild(child),\n (stack, child) => {\n stack.remove(child);\n },\n ),\n deferred<Gtk.Stack, string>(\"visibleChildName\", (stack, name) => stack.getChildByName(name) !== null),\n ],\n },\n GtkNotebook: {\n behaviors: [\n slot<Gtk.Notebook, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (notebook, child, info) => notebook.insertPage(child, null, info.index),\n reorder: (notebook, child, info) => {\n notebook.reorderChild(child, info.index);\n },\n detach: (notebook, child) => {\n notebook.detachTab(child);\n },\n resolve: (notebook, child) => notebook.getPage(child),\n }),\n ],\n },\n GtkApplication: {\n behaviors: [\n applicationCreator(Gtk.Application),\n addRemoveSlot<Gtk.Window, Gtk.Application>(\n \"children\",\n \"GtkWindow\",\n (application, window) => {\n application.addWindow(window);\n },\n (application, window) => {\n application.removeWindow(window);\n },\n ),\n list<Gtk.Application, ActionAccel>(\"actionAccels\", {\n add: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, item.accels);\n },\n remove: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, []);\n },\n }),\n list<Gtk.Application, MainOption>(\"mainOptions\", {\n add: (application, option) => {\n addMainOption(application, option);\n },\n }),\n ],\n },\n GtkAboutDialog: {\n behaviors: [\n list<Gtk.AboutDialog, CreditSection>(\"creditSections\", {\n add: (dialog, section) => {\n dialog.addCreditSection(section.sectionName, section.people);\n },\n }),\n ],\n },\n GtkScale: {\n behaviors: [\n list<Gtk.Scale, ScaleMark>(\"marks\", {\n add: (scale, mark) => {\n scale.addMark(mark.value ?? 0, mark.position, mark.markup ?? null);\n },\n clear: (scale) => {\n scale.clearMarks();\n },\n }),\n ],\n },\n GtkCalendar: {\n behaviors: [\n list<Gtk.Calendar, number>(\"markedDays\", {\n add: (calendar, day) => {\n calendar.markDay(day);\n },\n clear: (calendar) => {\n calendar.clearMarks();\n },\n }),\n ],\n },\n GtkLevelBar: {\n behaviors: [\n list<Gtk.LevelBar, LevelBarOffset>(\"offsets\", {\n add: (bar, offset) => {\n bar.addOffsetValue(offset.name, offset.value ?? 0);\n },\n remove: (bar, offset) => {\n bar.removeOffsetValue(offset.name);\n },\n }),\n ],\n },\n GtkDropTarget: {\n behaviors: [\n value<Gtk.DropTarget, GObject.Type[]>(\"types\", (target, types) => {\n target.setGtypes(types);\n }),\n ],\n },\n GtkDrawingArea: {\n behaviors: [\n value<Gtk.DrawingArea, Gtk.DrawingAreaDrawFunc>(\"drawFunc\", (area, draw) => {\n area.setDrawFunc(draw);\n area.queueDraw();\n }),\n ],\n },\n GtkDragSource: {\n behaviors: [\n value<Gtk.DragSource, DragSourceIcon>(\"icon\", (source, icon) => {\n source.setIcon(icon.paintable ?? null, icon.hotX ?? 0, icon.hotY ?? 0);\n }),\n ],\n },\n GtkEditable: {\n behaviors: [controlledText(\"text\")],\n },\n};\n\nfunction layoutChild(parent: Gtk.Widget, child: Gtk.Widget): GObject.Object | null {\n return parent.getLayoutManager()?.getLayoutChild(child) ?? null;\n}\n\nconst addMainOption = (application: Gtk.Application, option: MainOption): void => {\n application.addMainOption(\n option.longName,\n option.shortName?.codePointAt(0) ?? 0,\n option.flags ?? GLib.OptionFlags.NONE,\n option.arg ?? GLib.OptionArg.NONE,\n option.description,\n option.argDescription ?? null,\n );\n};\n\nconst buildMenu = (items: MenuItem[]): Gio.Menu => {\n const menu = Gio.Menu.new();\n\n for (const item of items) {\n appendMenuItem(menu, item);\n }\n\n return menu;\n};\n\nfunction appendMenuItem(menu: Gio.Menu, item: MenuItem): void {\n const label = item.label ?? null;\n\n if (item.submenu !== undefined) {\n menu.appendSubmenu(label, buildMenu(item.submenu));\n\n return;\n }\n\n if (item.section !== undefined) {\n menu.appendSection(label, buildMenu(item.section));\n\n return;\n }\n\n menu.append(label, item.action ?? null);\n}\n\nregisterElements(BUILTIN_ELEMENTS);\nregisterElements(BUILTIN_BEHAVIORS);\n"]}
|
|
1
|
+
{"version":3,"file":"element-behaviors.js","sourceRoot":"","sources":["../src/element-behaviors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAWpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,c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C,IAAI,EACrC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EACjC,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,cAAc,IAAI,IAAI,CAChC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAY,EAAE;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAE5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,SAAS,cAAc,CAAC,IAAc,EAAE,IAAc;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;IAEjC,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,OAAO;IACX,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACnC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gio from \"@gtkx/gi/gio\";\nimport * as GLib from \"@gtkx/gi/glib\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n ActionAccel,\n CreditSection,\n DragSourceIcon,\n LevelBarOffset,\n MainOption,\n MenuItem,\n ScaleMark,\n VflConstraints,\n} from \"./prop-types.js\";\nimport { BUILTIN_ELEMENTS, SINGLE_CHILD_TYPES } from \"./element-config.js\";\nimport {\n addRemoveSlot,\n adoptedChildrenSlot,\n applicationCreator,\n boxSlot,\n childSetterSlot,\n controlledText,\n deferred,\n list,\n slot,\n value,\n wrappingIndexedSlot,\n} from \"./reconciler/behaviors.js\";\nimport {\n type ElementBehavior,\n type ElementConfig,\n forTypes,\n type Props,\n registerElements,\n} from \"./reconciler/registry.js\";\nimport { applyWrite } from \"./reconciler/signals.js\";\nimport { applyStyle, styleClass } from \"./reconciler/style.js\";\n\nconst BUILTIN_BEHAVIORS: Record<string, ElementConfig<never>> = {\n ...forTypes(SINGLE_CHILD_TYPES, {\n behaviors: [childSetterSlot()],\n }),\n ...forTypes([\"GtkHeaderBar\", \"GtkActionBar\"], {\n behaviors: [\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"start\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packStart(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n addRemoveSlot<Gtk.Widget, Gtk.HeaderBar | Gtk.ActionBar>(\n \"end\",\n \"GtkWidget\",\n (bar, child) => {\n bar.packEnd(child);\n },\n (bar, child) => {\n bar.remove(child);\n },\n ),\n ],\n }),\n GtkWindow: {\n behaviors: [childSetterSlot()],\n },\n GtkWidget: {\n behaviors: [\n slot<Gtk.Widget, Gtk.Popover>(\"children\", \"GtkPopover\", {\n attach: (parent, popover) => {\n popover.setParent(parent);\n },\n detach: (_parent, popover) => {\n popover.unparent();\n },\n }),\n addRemoveSlot<Gtk.EventController, Gtk.Widget>(\n \"controllers\",\n \"GtkEventController\",\n (widget, controller) => {\n widget.addController(controller);\n },\n (widget, controller) => {\n widget.removeController(controller);\n },\n ),\n slot<Gtk.Widget, Gtk.LayoutManager>(\"layoutManager\", \"GtkLayoutManager\", {\n attach: (widget, manager) => {\n widget.setLayoutManager(manager);\n },\n detach: (widget) => {\n widget.setLayoutManager(null);\n },\n }),\n slot<Gtk.Widget, Gio.ActionGroup>(\"actionGroups\", \"GActionGroup\", {\n attach: (widget, group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", group);\n },\n detach: (widget, _group, info) => {\n widget.insertActionGroup((info.props.prefix as string | null) ?? \"\", null);\n },\n }),\n styleBehavior(),\n ],\n },\n GtkBox: {\n behaviors: [boxSlot<Gtk.Box>()],\n },\n GtkListBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.ListBoxRow, (row, inner) => {\n row.setChild(inner);\n }),\n ],\n },\n GtkFlowBox: {\n behaviors: [\n wrappingIndexedSlot(Gtk.FlowBoxChild, (child, inner) => {\n child.setChild(inner);\n }),\n ],\n },\n GtkOverlay: {\n behaviors: [\n childSetterSlot<Gtk.Overlay>(),\n slot<Gtk.Overlay, Gtk.Widget>(\"overlays\", \"GtkWidget\", {\n attach: (overlay, child) => {\n overlay.addOverlay(child);\n },\n detach: (overlay, child) => {\n overlay.removeOverlay(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkShortcutController: {\n behaviors: [\n addRemoveSlot<Gtk.Shortcut, Gtk.ShortcutController>(\n \"shortcuts\",\n \"GtkShortcut\",\n (controller, shortcut) => {\n controller.addShortcut(shortcut);\n },\n (controller, shortcut) => {\n controller.removeShortcut(shortcut);\n },\n ),\n ],\n },\n GtkTextChildAnchor: {\n behaviors: [{ create: () => Gtk.TextChildAnchor.new() }],\n },\n GtkTextView: {\n behaviors: [\n slot<Gtk.TextView, Gtk.TextBuffer>(\"children\", \"GtkTextBuffer\", {\n attach: (view, buffer) => {\n view.setBuffer(buffer);\n },\n detach: (view) => {\n view.setBuffer(null);\n },\n }),\n ],\n },\n GActionMap: {\n behaviors: [\n slot<Gio.ActionMap, Gio.Action>(\"actions\", \"GAction\", {\n attach: (map, action) => {\n map.addAction(action);\n },\n detach: (map, _action, info) => {\n map.removeAction((info.props.name as string | null) ?? \"\");\n },\n }),\n ],\n },\n GMenu: {\n behaviors: [\n list<Gio.Menu, MenuItem>(\"items\", {\n clear: (menu) => {\n menu.removeAll();\n },\n add: (menu, item) => {\n appendMenuItem(menu, item);\n },\n }),\n ],\n },\n GtkColumnView: {\n behaviors: [\n slot<Gtk.ColumnView, Gtk.ColumnViewColumn>(\"children\", \"GtkColumnViewColumn\", {\n attach: (view, column, info) => {\n view.insertColumn(info.index, column);\n },\n detach: (view, column) => {\n view.removeColumn(column);\n },\n }),\n ],\n },\n GtkGrid: {\n behaviors: [\n slot<Gtk.Grid, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (grid, child) => {\n grid.attach(child, 0, 0, 1, 1);\n },\n detach: (grid, child) => {\n grid.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkFixed: {\n behaviors: [\n slot<Gtk.Fixed, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (fixed, child) => {\n fixed.put(child, 0, 0);\n },\n detach: (fixed, child) => {\n fixed.remove(child);\n },\n resolve: layoutChild,\n }),\n ],\n },\n GtkSizeGroup: {\n behaviors: [\n list<Gtk.SizeGroup, Gtk.Widget>(\"widgets\", {\n add: (group, widget) => {\n group.addWidget(widget);\n },\n remove: (group, widget) => {\n group.removeWidget(widget);\n },\n }),\n ],\n },\n GtkConstraintLayout: {\n behaviors: [\n addRemoveSlot<Gtk.Constraint, Gtk.ConstraintLayout>(\n \"constraints\",\n \"GtkConstraint\",\n (layout, constraint) => {\n layout.addConstraint(constraint);\n },\n (layout, constraint) => {\n layout.removeConstraint(constraint);\n },\n ),\n addRemoveSlot<Gtk.ConstraintGuide, Gtk.ConstraintLayout>(\n \"guides\",\n \"GtkConstraintGuide\",\n (layout, guide) => {\n layout.addGuide(guide);\n },\n (layout, guide) => {\n layout.removeGuide(guide);\n },\n ),\n list<Gtk.ConstraintLayout, VflConstraints, Gtk.Constraint[]>(\"vfl\", {\n add: (layout, item) => [\n ...layout.addConstraintsFromDescription(\n item.lines,\n item.hspacing ?? 0,\n item.vspacing ?? 0,\n item.views ?? new Map<string, Gtk.ConstraintTarget>(),\n ),\n ],\n remove: (layout, _item, constraints) => {\n for (const constraint of constraints) {\n layout.removeConstraint(constraint);\n }\n },\n }),\n ],\n },\n GtkStack: {\n behaviors: [\n adoptedChildrenSlot<Gtk.Stack, Gtk.Widget>(\n \"GtkWidget\",\n (stack, child) => stack.addChild(child),\n (stack, child) => {\n stack.remove(child);\n },\n ),\n deferred<Gtk.Stack, string>(\"visibleChildName\", (stack, name) => stack.getChildByName(name) !== null),\n ],\n },\n GtkNotebook: {\n behaviors: [\n slot<Gtk.Notebook, Gtk.Widget>(\"children\", \"GtkWidget\", {\n attach: (notebook, child, info) => notebook.insertPage(child, null, info.index),\n reorder: (notebook, child, info) => {\n notebook.reorderChild(child, info.index);\n },\n detach: (notebook, child) => {\n notebook.detachTab(child);\n },\n resolve: (notebook, child) => notebook.getPage(child),\n }),\n ],\n },\n GtkApplication: {\n behaviors: [\n applicationCreator(Gtk.Application),\n addRemoveSlot<Gtk.Window, Gtk.Application>(\n \"children\",\n \"GtkWindow\",\n (application, window) => {\n application.addWindow(window);\n },\n (application, window) => {\n application.removeWindow(window);\n },\n ),\n list<Gtk.Application, ActionAccel>(\"actionAccels\", {\n add: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, item.accels);\n },\n remove: (application, item) => {\n application.setAccelsForAction(item.detailedActionName, []);\n },\n }),\n list<Gtk.Application, MainOption>(\"mainOptions\", {\n add: (application, option) => {\n addMainOption(application, option);\n },\n }),\n ],\n },\n GtkAboutDialog: {\n behaviors: [\n list<Gtk.AboutDialog, CreditSection>(\"creditSections\", {\n add: (dialog, section) => {\n dialog.addCreditSection(section.sectionName, section.people);\n },\n }),\n ],\n },\n GtkScale: {\n behaviors: [\n list<Gtk.Scale, ScaleMark>(\"marks\", {\n add: (scale, mark) => {\n scale.addMark(mark.value ?? 0, mark.position, mark.markup ?? null);\n },\n clear: (scale) => {\n scale.clearMarks();\n },\n }),\n ],\n },\n GtkCalendar: {\n behaviors: [\n list<Gtk.Calendar, number>(\"markedDays\", {\n add: (calendar, day) => {\n calendar.markDay(day);\n },\n clear: (calendar) => {\n calendar.clearMarks();\n },\n }),\n ],\n },\n GtkLevelBar: {\n behaviors: [\n list<Gtk.LevelBar, LevelBarOffset>(\"offsets\", {\n add: (bar, offset) => {\n bar.addOffsetValue(offset.name, offset.value ?? 0);\n },\n remove: (bar, offset) => {\n bar.removeOffsetValue(offset.name);\n },\n }),\n ],\n },\n GtkDropTarget: {\n behaviors: [\n value<Gtk.DropTarget, GObject.Type[]>(\"types\", (target, types) => {\n target.setGtypes(types);\n }),\n ],\n },\n GtkDrawingArea: {\n behaviors: [\n value<Gtk.DrawingArea, Gtk.DrawingAreaDrawFunc>(\"drawFunc\", (area, draw) => {\n area.setDrawFunc(draw);\n area.queueDraw();\n }),\n ],\n },\n GtkDragSource: {\n behaviors: [\n value<Gtk.DragSource, DragSourceIcon>(\"icon\", (source, icon) => {\n source.setIcon(icon.paintable ?? null, icon.hotX ?? 0, icon.hotY ?? 0);\n }),\n ],\n },\n GtkEditable: {\n behaviors: [controlledText(\"text\")],\n },\n};\n\nfunction layoutChild(parent: Gtk.Widget, child: Gtk.Widget): GObject.Object | null {\n return parent.getLayoutManager()?.getLayoutChild(child) ?? null;\n}\n\nconst isNullish = (value: unknown): boolean => value === undefined || value === null;\nconst isInitialNull = (prevValue: unknown, value: unknown): boolean => value === null && prevValue === undefined;\n\nconst withStyleClass = (classes: unknown, className: string): string[] =>\n Array.isArray(classes) ? [...(classes as string[]), className] : [className];\n\nconst hasCssClassesChange = (prev: Props, next: Props): boolean => {\n const classes = next.cssClasses;\n\n if (classes === undefined || Object.is(prev.cssClasses, classes)) {\n return false;\n }\n\n return !isInitialNull(prev.cssClasses, classes);\n};\n\nconst didWriteCssClasses = (widget: Gtk.Widget, prev: Props, next: Props, className: string | null): boolean => {\n if (className === null || !hasCssClassesChange(prev, next)) {\n return false;\n }\n\n applyWrite(() => {\n Reflect.set(widget, \"cssClasses\", withStyleClass(next.cssClasses, className));\n });\n\n return true;\n};\n\nconst isRestyled = (prev: Props, next: Props): boolean => {\n if (isNullish(prev.style) && isNullish(next.style)) {\n return false;\n }\n\n return !Object.is(prev.style, next.style);\n};\n\nfunction updateStyle(widget: Gtk.Widget, prev: Props, next: Props): Iterable<string> | undefined {\n const isChanged = isRestyled(prev, next);\n const className = isChanged ? applyStyle(widget, next.style) : styleClass(widget);\n\n if (!isChanged && className === null) {\n return;\n }\n\n return didWriteCssClasses(widget, prev, next, className) ? [\"style\", \"cssClasses\"] : [\"style\"];\n}\n\nfunction styleBehavior(): ElementBehavior<Gtk.Widget> {\n return { update: updateStyle };\n}\n\nconst addMainOption = (application: Gtk.Application, option: MainOption): void => {\n application.addMainOption(\n option.longName,\n option.shortName?.codePointAt(0) ?? 0,\n option.flags ?? GLib.OptionFlags.NONE,\n option.arg ?? GLib.OptionArg.NONE,\n option.description,\n option.argDescription ?? null,\n );\n};\n\nconst buildMenu = (items: MenuItem[]): Gio.Menu => {\n const menu = Gio.Menu.new();\n\n for (const item of items) {\n appendMenuItem(menu, item);\n }\n\n return menu;\n};\n\nfunction appendMenuItem(menu: Gio.Menu, item: MenuItem): void {\n const label = item.label ?? null;\n\n if (item.submenu !== undefined) {\n menu.appendSubmenu(label, buildMenu(item.submenu));\n\n return;\n }\n\n if (item.section !== undefined) {\n menu.appendSection(label, buildMenu(item.section));\n\n return;\n }\n\n menu.append(label, item.action ?? null);\n}\n\nregisterElements(BUILTIN_ELEMENTS);\nregisterElements(BUILTIN_BEHAVIORS);\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -14,5 +14,7 @@ export type * from "./prop-types.js";
|
|
|
14
14
|
export { settleAccessible } from "./reconciler/apply-props.js";
|
|
15
15
|
export { isRootElement } from "./reconciler/root-element.js";
|
|
16
16
|
export { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
|
|
17
|
+
export { applyWrite } from "./reconciler/signals.js";
|
|
18
|
+
export { applyStyle } from "./reconciler/style.js";
|
|
17
19
|
export type { SettingsSchema, SettingsSchemaKeys, SettingValue } from "./utils/settings.js";
|
|
18
20
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,gBAAgB;AAChB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,gBAAgB;AAChB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,gBAAgB;AAChB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,gBAAgB;AAChB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,gBAAgB;AAChB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,gBAAgB;AAChB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -13,4 +13,6 @@ export { useMergedRef } from "./hooks/use-merged-refs.js";
|
|
|
13
13
|
export { settleAccessible } from "./reconciler/apply-props.js";
|
|
14
14
|
export { isRootElement } from "./reconciler/root-element.js";
|
|
15
15
|
export { createReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
|
|
16
|
+
export { applyWrite } from "./reconciler/signals.js";
|
|
17
|
+
export { applyStyle } from "./reconciler/style.js";
|
|
16
18
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,gBAAgB;AAChB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,gBAAgB;AAChB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,gBAAgB;AAChB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAuB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\n/** @internal */\nexport { createApplicationWindowComponent } from \"./components/application-window.js\";\n/** @internal */\nexport { createApplicationComponent } from \"./components/application.js\";\nexport { createElementComponent } from \"./components/element.js\";\n/** @internal */\nexport { createPortaledComponent } from \"./components/portaled.js\";\n/** @internal */\nexport { createWindowComponent } from \"./components/window.js\";\nexport { useLatestRef } from \"./hooks/use-latest-ref.js\";\nexport { useMergedRef } from \"./hooks/use-merged-refs.js\";\nexport type * from \"./prop-types.js\";\nexport { settleAccessible } from \"./reconciler/apply-props.js\";\nexport { isRootElement } from \"./reconciler/root-element.js\";\nexport { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from \"./reconciler/root.js\";\nexport type { SettingsSchema, SettingsSchemaKeys, SettingValue } from \"./utils/settings.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,gBAAgB;AAChB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,gBAAgB;AAChB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,gBAAgB;AAChB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAuB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\n/** @internal */\nexport { createApplicationWindowComponent } from \"./components/application-window.js\";\n/** @internal */\nexport { createApplicationComponent } from \"./components/application.js\";\nexport { createElementComponent } from \"./components/element.js\";\n/** @internal */\nexport { createPortaledComponent } from \"./components/portaled.js\";\n/** @internal */\nexport { createWindowComponent } from \"./components/window.js\";\nexport { useLatestRef } from \"./hooks/use-latest-ref.js\";\nexport { useMergedRef } from \"./hooks/use-merged-refs.js\";\nexport type * from \"./prop-types.js\";\nexport { settleAccessible } from \"./reconciler/apply-props.js\";\nexport { isRootElement } from \"./reconciler/root-element.js\";\nexport { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from \"./reconciler/root.js\";\nexport { applyWrite } from \"./reconciler/signals.js\";\nexport { applyStyle } from \"./reconciler/style.js\";\nexport type { SettingsSchema, SettingsSchemaKeys, SettingValue } from \"./utils/settings.js\";\n"]}
|
package/dist/prop-types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type * as Gdk from "@gtkx/gi/gdk";
|
|
|
2
2
|
import type * as GLib from "@gtkx/gi/glib";
|
|
3
3
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
4
4
|
import type * as Gtk from "@gtkx/gi/gtk";
|
|
5
|
-
import type { ReactNode } from "react";
|
|
5
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
6
6
|
/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */
|
|
7
7
|
type MenuItem = {
|
|
8
8
|
/** Text shown for the entry, or the heading of the submenu or section it introduces. */
|
|
@@ -84,12 +84,22 @@ type ChildrenProps = {
|
|
|
84
84
|
/** Elements attached to the element's default child slot, or its text for elements that hold text. */
|
|
85
85
|
children?: ReactNode;
|
|
86
86
|
};
|
|
87
|
+
/** Paint and typography declarations GTK4 CSS accepts, spelled the way React DOM spells them. */
|
|
88
|
+
type StyleProperties = Pick<CSSProperties, "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "background" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "boxShadow" | "caretColor" | "color" | "filter" | "font" | "fontFamily" | "fontSize" | "fontStyle" | "fontVariant" | "fontWeight" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "minHeight" | "minWidth" | "opacity" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textDecoration" | "textDecorationColor" | "textDecorationLine" | "textDecorationStyle" | "textShadow" | "textTransform" | "transform" | "transformOrigin" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction">;
|
|
89
|
+
/**
|
|
90
|
+
* Style declarations for one widget. A key starting with `&` nests a block under a selector derived from
|
|
91
|
+
* it, such as `"&:hover"` or `"& label"`. GTK4 CSS covers paint and typography only, so layout properties
|
|
92
|
+
* such as `display`, `width` and `gap` are deliberately absent; use the widget's own layout props instead.
|
|
93
|
+
*/
|
|
94
|
+
type Style = StyleProperties & Partial<Record<`&${string}`, StyleProperties>>;
|
|
87
95
|
/** Objects a widget takes through a method call rather than a property. */
|
|
88
96
|
type GtkWidgetProps = {
|
|
89
97
|
/** `Gtk.EventController` elements added to the widget. */
|
|
90
98
|
controllers?: ReactNode | null | undefined;
|
|
91
99
|
/** `Gio.ActionGroup` elements inserted into the widget, each under its own `prefix`. */
|
|
92
100
|
actionGroups?: ReactNode | null | undefined;
|
|
101
|
+
/** Style declarations applied to this widget alone, outranking any class in `cssClasses`. */
|
|
102
|
+
style?: Style | null | undefined;
|
|
93
103
|
} & ChildrenProps;
|
|
94
104
|
/** Props of an action group placed in a widget's `actionGroups` slot. */
|
|
95
105
|
type ActionGroupProps = {
|
|
@@ -190,5 +200,5 @@ type GtkDragSourceProps = {
|
|
|
190
200
|
/** Icon shown under the pointer while a drag started from this source is in flight. */
|
|
191
201
|
icon?: DragSourceIcon | null | undefined;
|
|
192
202
|
};
|
|
193
|
-
export { type MenuItem, type VflConstraints, type ScaleMark, type LevelBarOffset, type CreditSection, type MainOption, type ActionAccel, type DragSourceIcon, type ChildrenProps, type GtkWidgetProps, type ActionGroupProps, type ActionMapProps, type MenuProps, type GtkShortcutControllerProps, type GtkOverlayProps, type GtkTextChildAnchorProps, type GtkConstraintLayoutProps, type GtkHeaderBarProps, type GtkScaleProps, type GtkCalendarProps, type GtkLevelBarProps, type GtkSizeGroupProps, type GtkAboutDialogProps, type GtkApplicationProps, type GtkDropTargetProps, type GtkDrawingAreaProps, type GtkDragSourceProps, };
|
|
203
|
+
export { type MenuItem, type VflConstraints, type ScaleMark, type LevelBarOffset, type CreditSection, type MainOption, type ActionAccel, type DragSourceIcon, type ChildrenProps, type GtkWidgetProps, type Style, type StyleProperties, type ActionGroupProps, type ActionMapProps, type MenuProps, type GtkShortcutControllerProps, type GtkOverlayProps, type GtkTextChildAnchorProps, type GtkConstraintLayoutProps, type GtkHeaderBarProps, type GtkScaleProps, type GtkCalendarProps, type GtkLevelBarProps, type GtkSizeGroupProps, type GtkAboutDialogProps, type GtkApplicationProps, type GtkDropTargetProps, type GtkDrawingAreaProps, type GtkDragSourceProps, };
|
|
194
204
|
//# sourceMappingURL=prop-types.d.ts.map
|
package/dist/prop-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,KAAK,IAAI,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,KAAK,IAAI,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,yFAAyF;AACzF,KAAK,QAAQ,GAAG;IACZ,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,M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C5B,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GAC1B,CAAC"}
|
package/dist/prop-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AA6NA,OAAO,EA4BN,CAAC","sourcesContent":["/* eslint-disable gtkx/no-library-prefix */\nimport type * as Gdk from \"@gtkx/gi/gdk\";\nimport type * as GLib from \"@gtkx/gi/glib\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ReactNode } from \"react\";\n\n/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */\ntype MenuItem = {\n /** Text shown for the entry, or the heading of the submenu or section it introduces. */\n label?: string | null;\n /** Detailed action name the entry activates, ignored when `submenu` or `section` is given. */\n action?: string | null;\n /** Entries of a separate menu the labelled entry opens. */\n submenu?: MenuItem[];\n /** Entries appended below the label as an inline section, used only when `submenu` is absent. */\n section?: MenuItem[];\n};\n\n/** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */\ntype VflConstraints = {\n /** Format lines, each describing every constraint on one row or column. */\n lines: string[];\n /** Default horizontal spacing the `-` operator stands for; defaults to 0. */\n hspacing?: number;\n /** Default vertical spacing the `-` operator stands for; defaults to 0. */\n vspacing?: number;\n /** Targets the view names in `lines` refer to; defaults to none. */\n views?: Map<string, Gtk.ConstraintTarget>;\n};\n\n/** One mark on a `Gtk.Scale`. */\ntype ScaleMark = {\n /** Point on the scale the mark is drawn at; defaults to 0. */\n value?: number;\n /** Side of the scale the mark and its label sit on. */\n position: Gtk.PositionType;\n /** Pango markup drawn beside the mark, or `null` for an unlabelled one. */\n markup?: string | null;\n};\n\n/** One labelled offset on a `Gtk.LevelBar`. */\ntype LevelBarOffset = {\n /** Style class applied to the bar's blocks while the value falls in this offset's interval. */\n name: string;\n /** Upper bound of that interval; defaults to 0. */\n value?: number;\n};\n\n/** One credit section on a `Gtk.AboutDialog`. */\ntype CreditSection = {\n /** Heading the names are listed under. */\n sectionName: string;\n /** Names listed in the section. */\n people: string[];\n};\n\n/** One command-line option a `Gtk.Application` accepts. */\ntype MainOption = {\n /** Name the option is spelled with after two dashes, such as `verbose` for `--verbose`. */\n longName: string;\n /** Single character the option is spelled with after one dash, such as `v` for `-v`; defaults to none. */\n shortName?: string | null;\n /** How the option itself is parsed and listed; defaults to `GLib.OptionFlags.NONE`. */\n flags?: GLib.OptionFlags;\n /** Type of argument the option takes; defaults to `GLib.OptionArg.NONE`, meaning it takes none. */\n arg?: GLib.OptionArg;\n /** Text describing the option in `--help`. */\n description: string;\n /** Placeholder standing for the option's argument in `--help`; defaults to none. */\n argDescription?: string | null;\n};\n\n/** One accelerator binding on a `Gtk.Application`. */\ntype ActionAccel = {\n /** Action the accelerators activate, such as `app.quit` or `win.open('file')`. */\n detailedActionName: string;\n /** Accelerators in `Gtk.acceleratorParse` syntax, cleared when the entry goes away. */\n accels: string[];\n};\n\n/** The drag icon of a `Gtk.DragSource`, with its hotspot. */\ntype DragSourceIcon = {\n /** Image shown under the pointer during the drag; defaults to none. */\n paintable?: Gdk.Paintable | null;\n /** Horizontal offset of the pointer within the image; defaults to 0. */\n hotX?: number;\n /** Vertical offset of the pointer within the image; defaults to 0. */\n hotY?: number;\n};\n\n/** Props of an element that accepts children. */\ntype ChildrenProps = {\n /** Elements attached to the element's default child slot, or its text for elements that hold text. */\n children?: ReactNode;\n};\n\n/** Objects a widget takes through a method call rather than a property. */\ntype GtkWidgetProps = {\n /** `Gtk.EventController` elements added to the widget. */\n controllers?: ReactNode | null | undefined;\n /** `Gio.ActionGroup` elements inserted into the widget, each under its own `prefix`. */\n actionGroups?: ReactNode | null | undefined;\n} & ChildrenProps;\n\n/** Props of an action group placed in a widget's `actionGroups` slot. */\ntype ActionGroupProps = {\n /** Prefix the group's actions are addressed by, such as `win`; defaults to the empty string. */\n prefix?: string | null | undefined;\n};\n\n/** Props of an element implementing `Gio.ActionMap`. */\ntype ActionMapProps = {\n /** `Gio.Action` elements added to the map, removed again by their `name`. */\n actions?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gio.Menu` element. */\ntype MenuProps = {\n /** Entries the menu is rebuilt from whenever they change. */\n items?: MenuItem[] | null | undefined;\n};\n\n/** Props of a `Gtk.ShortcutController` element. */\ntype GtkShortcutControllerProps = {\n /** `Gtk.Shortcut` elements the controller watches for. */\n shortcuts?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gtk.Overlay` element, whose `children` is the widget the overlays sit above. */\ntype GtkOverlayProps = {\n /** Widgets stacked over the main child. */\n overlays?: ReactNode | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.ConstraintLayout` element. */\ntype GtkConstraintLayoutProps = {\n /** `Gtk.Constraint` elements added to the layout. */\n constraints?: ReactNode | null | undefined;\n /** `Gtk.ConstraintGuide` elements added to the layout as invisible spacers. */\n guides?: ReactNode | null | undefined;\n /** Visual Format Language blocks whose constraints are added alongside `constraints`. */\n vfl?: VflConstraints[] | null | undefined;\n};\n\n/** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */\ntype GtkTextChildAnchorProps = {\n /** Image inserted into the buffer instead of an anchored widget; giving both is an error. */\n paintable?: Gdk.Paintable | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.HeaderBar` or `Gtk.ActionBar` element. */\ntype GtkHeaderBarProps = {\n /** Widgets packed at the start of the bar. */\n start?: ReactNode | null | undefined;\n /** Widgets packed at the end of the bar. */\n end?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gtk.Scale` element. */\ntype GtkScaleProps = {\n /** Marks drawn along the scale, cleared and re-added whenever the list changes. */\n marks?: ScaleMark[] | null | undefined;\n};\n\n/** Props of a `Gtk.Calendar` element. */\ntype GtkCalendarProps = {\n /** Days of the shown month drawn as marked, cleared and re-marked whenever the list changes. */\n markedDays?: number[] | null | undefined;\n};\n\n/** Props of a `Gtk.LevelBar` element. */\ntype GtkLevelBarProps = {\n /** Offsets that split the bar's range into differently styled intervals. */\n offsets?: LevelBarOffset[] | null | undefined;\n};\n\n/** Props of a `Gtk.SizeGroup` element. */\ntype GtkSizeGroupProps = {\n /** Widgets the group keeps at a common size. */\n widgets?: Gtk.Widget[] | null | undefined;\n};\n\n/** Props of a `Gtk.AboutDialog` element. */\ntype GtkAboutDialogProps = {\n /**\n * Extra sections appended to the dialog's credits. GTK offers no way to remove one, so the list\n * cannot change once it has been applied.\n */\n creditSections?: CreditSection[] | null | undefined;\n};\n\n/** Props of a `Gtk.Application` element, whose `children` are the windows it owns. */\ntype GtkApplicationProps = {\n /** Accelerators bound to the application's actions. */\n actionAccels?: ActionAccel[] | null | undefined;\n /**\n * Command-line options the application parses, registered before it starts. GLib offers no way to\n * unregister one, so the list cannot change once it has been applied.\n */\n mainOptions?: MainOption[] | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.DropTarget` element. */\ntype GtkDropTargetProps = {\n /** GTypes the target accepts a drop of. */\n types?: GObject.Type[] | null | undefined;\n};\n\n/** Props of a `Gtk.DrawingArea` element. */\ntype GtkDrawingAreaProps = {\n /** Callback that draws the area's contents; setting it queues a redraw. */\n drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;\n};\n\n/** Props of a `Gtk.DragSource` element. */\ntype GtkDragSourceProps = {\n /** Icon shown under the pointer while a drag started from this source is in flight. */\n icon?: DragSourceIcon | null | undefined;\n};\n\nexport {\n type MenuItem,\n type VflConstraints,\n type ScaleMark,\n type LevelBarOffset,\n type CreditSection,\n type MainOption,\n type ActionAccel,\n type DragSourceIcon,\n type ChildrenProps,\n type GtkWidgetProps,\n type ActionGroupProps,\n type ActionMapProps,\n type MenuProps,\n type GtkShortcutControllerProps,\n type GtkOverlayProps,\n type GtkTextChildAnchorProps,\n type GtkConstraintLayoutProps,\n type GtkHeaderBarProps,\n type GtkScaleProps,\n type GtkCalendarProps,\n type GtkLevelBarProps,\n type GtkSizeGroupProps,\n type GtkAboutDialogProps,\n type GtkApplicationProps,\n type GtkDropTargetProps,\n type GtkDrawingAreaProps,\n type GtkDragSourceProps,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"prop-types.js","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AAgTA,OAAO,EA8BN,CAAC","sourcesContent":["/* eslint-disable gtkx/no-library-prefix */\nimport type * as Gdk from \"@gtkx/gi/gdk\";\nimport type * as GLib from \"@gtkx/gi/glib\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { CSSProperties, ReactNode } from \"react\";\n\n/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */\ntype MenuItem = {\n /** Text shown for the entry, or the heading of the submenu or section it introduces. */\n label?: string | null;\n /** Detailed action name the entry activates, ignored when `submenu` or `section` is given. */\n action?: string | null;\n /** Entries of a separate menu the labelled entry opens. */\n submenu?: MenuItem[];\n /** Entries appended below the label as an inline section, used only when `submenu` is absent. */\n section?: MenuItem[];\n};\n\n/** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */\ntype VflConstraints = {\n /** Format lines, each describing every constraint on one row or column. */\n lines: string[];\n /** Default horizontal spacing the `-` operator stands for; defaults to 0. */\n hspacing?: number;\n /** Default vertical spacing the `-` operator stands for; defaults to 0. */\n vspacing?: number;\n /** Targets the view names in `lines` refer to; defaults to none. */\n views?: Map<string, Gtk.ConstraintTarget>;\n};\n\n/** One mark on a `Gtk.Scale`. */\ntype ScaleMark = {\n /** Point on the scale the mark is drawn at; defaults to 0. */\n value?: number;\n /** Side of the scale the mark and its label sit on. */\n position: Gtk.PositionType;\n /** Pango markup drawn beside the mark, or `null` for an unlabelled one. */\n markup?: string | null;\n};\n\n/** One labelled offset on a `Gtk.LevelBar`. */\ntype LevelBarOffset = {\n /** Style class applied to the bar's blocks while the value falls in this offset's interval. */\n name: string;\n /** Upper bound of that interval; defaults to 0. */\n value?: number;\n};\n\n/** One credit section on a `Gtk.AboutDialog`. */\ntype CreditSection = {\n /** Heading the names are listed under. */\n sectionName: string;\n /** Names listed in the section. */\n people: string[];\n};\n\n/** One command-line option a `Gtk.Application` accepts. */\ntype MainOption = {\n /** Name the option is spelled with after two dashes, such as `verbose` for `--verbose`. */\n longName: string;\n /** Single character the option is spelled with after one dash, such as `v` for `-v`; defaults to none. */\n shortName?: string | null;\n /** How the option itself is parsed and listed; defaults to `GLib.OptionFlags.NONE`. */\n flags?: GLib.OptionFlags;\n /** Type of argument the option takes; defaults to `GLib.OptionArg.NONE`, meaning it takes none. */\n arg?: GLib.OptionArg;\n /** Text describing the option in `--help`. */\n description: string;\n /** Placeholder standing for the option's argument in `--help`; defaults to none. */\n argDescription?: string | null;\n};\n\n/** One accelerator binding on a `Gtk.Application`. */\ntype ActionAccel = {\n /** Action the accelerators activate, such as `app.quit` or `win.open('file')`. */\n detailedActionName: string;\n /** Accelerators in `Gtk.acceleratorParse` syntax, cleared when the entry goes away. */\n accels: string[];\n};\n\n/** The drag icon of a `Gtk.DragSource`, with its hotspot. */\ntype DragSourceIcon = {\n /** Image shown under the pointer during the drag; defaults to none. */\n paintable?: Gdk.Paintable | null;\n /** Horizontal offset of the pointer within the image; defaults to 0. */\n hotX?: number;\n /** Vertical offset of the pointer within the image; defaults to 0. */\n hotY?: number;\n};\n\n/** Props of an element that accepts children. */\ntype ChildrenProps = {\n /** Elements attached to the element's default child slot, or its text for elements that hold text. */\n children?: ReactNode;\n};\n\n/** Paint and typography declarations GTK4 CSS accepts, spelled the way React DOM spells them. */\ntype StyleProperties = Pick<\n CSSProperties,\n | \"animation\" |\n \"animationDelay\" |\n \"animationDirection\" |\n \"animationDuration\" |\n \"animationFillMode\" |\n \"animationIterationCount\" |\n \"animationName\" |\n \"animationPlayState\" |\n \"animationTimingFunction\" |\n \"background\" |\n \"backgroundClip\" |\n \"backgroundColor\" |\n \"backgroundImage\" |\n \"backgroundOrigin\" |\n \"backgroundPosition\" |\n \"backgroundRepeat\" |\n \"backgroundSize\" |\n \"border\" |\n \"borderBottom\" |\n \"borderColor\" |\n \"borderLeft\" |\n \"borderRadius\" |\n \"borderRight\" |\n \"borderStyle\" |\n \"borderTop\" |\n \"borderWidth\" |\n \"boxShadow\" |\n \"caretColor\" |\n \"color\" |\n \"filter\" |\n \"font\" |\n \"fontFamily\" |\n \"fontSize\" |\n \"fontStyle\" |\n \"fontVariant\" |\n \"fontWeight\" |\n \"letterSpacing\" |\n \"lineHeight\" |\n \"margin\" |\n \"marginBottom\" |\n \"marginLeft\" |\n \"marginRight\" |\n \"marginTop\" |\n \"minHeight\" |\n \"minWidth\" |\n \"opacity\" |\n \"outline\" |\n \"outlineColor\" |\n \"outlineOffset\" |\n \"outlineStyle\" |\n \"outlineWidth\" |\n \"padding\" |\n \"paddingBottom\" |\n \"paddingLeft\" |\n \"paddingRight\" |\n \"paddingTop\" |\n \"textDecoration\" |\n \"textDecorationColor\" |\n \"textDecorationLine\" |\n \"textDecorationStyle\" |\n \"textShadow\" |\n \"textTransform\" |\n \"transform\" |\n \"transformOrigin\" |\n \"transition\" |\n \"transitionDelay\" |\n \"transitionDuration\" |\n \"transitionProperty\" |\n \"transitionTimingFunction\"\n>;\n\n/**\n * Style declarations for one widget. A key starting with `&` nests a block under a selector derived from\n * it, such as `\"&:hover\"` or `\"& label\"`. GTK4 CSS covers paint and typography only, so layout properties\n * such as `display`, `width` and `gap` are deliberately absent; use the widget's own layout props instead.\n */\ntype Style = StyleProperties & Partial<Record<`&${string}`, StyleProperties>>;\n\n/** Objects a widget takes through a method call rather than a property. */\ntype GtkWidgetProps = {\n /** `Gtk.EventController` elements added to the widget. */\n controllers?: ReactNode | null | undefined;\n /** `Gio.ActionGroup` elements inserted into the widget, each under its own `prefix`. */\n actionGroups?: ReactNode | null | undefined;\n /** Style declarations applied to this widget alone, outranking any class in `cssClasses`. */\n style?: Style | null | undefined;\n} & ChildrenProps;\n\n/** Props of an action group placed in a widget's `actionGroups` slot. */\ntype ActionGroupProps = {\n /** Prefix the group's actions are addressed by, such as `win`; defaults to the empty string. */\n prefix?: string | null | undefined;\n};\n\n/** Props of an element implementing `Gio.ActionMap`. */\ntype ActionMapProps = {\n /** `Gio.Action` elements added to the map, removed again by their `name`. */\n actions?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gio.Menu` element. */\ntype MenuProps = {\n /** Entries the menu is rebuilt from whenever they change. */\n items?: MenuItem[] | null | undefined;\n};\n\n/** Props of a `Gtk.ShortcutController` element. */\ntype GtkShortcutControllerProps = {\n /** `Gtk.Shortcut` elements the controller watches for. */\n shortcuts?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gtk.Overlay` element, whose `children` is the widget the overlays sit above. */\ntype GtkOverlayProps = {\n /** Widgets stacked over the main child. */\n overlays?: ReactNode | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.ConstraintLayout` element. */\ntype GtkConstraintLayoutProps = {\n /** `Gtk.Constraint` elements added to the layout. */\n constraints?: ReactNode | null | undefined;\n /** `Gtk.ConstraintGuide` elements added to the layout as invisible spacers. */\n guides?: ReactNode | null | undefined;\n /** Visual Format Language blocks whose constraints are added alongside `constraints`. */\n vfl?: VflConstraints[] | null | undefined;\n};\n\n/** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */\ntype GtkTextChildAnchorProps = {\n /** Image inserted into the buffer instead of an anchored widget; giving both is an error. */\n paintable?: Gdk.Paintable | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.HeaderBar` or `Gtk.ActionBar` element. */\ntype GtkHeaderBarProps = {\n /** Widgets packed at the start of the bar. */\n start?: ReactNode | null | undefined;\n /** Widgets packed at the end of the bar. */\n end?: ReactNode | null | undefined;\n};\n\n/** Props of a `Gtk.Scale` element. */\ntype GtkScaleProps = {\n /** Marks drawn along the scale, cleared and re-added whenever the list changes. */\n marks?: ScaleMark[] | null | undefined;\n};\n\n/** Props of a `Gtk.Calendar` element. */\ntype GtkCalendarProps = {\n /** Days of the shown month drawn as marked, cleared and re-marked whenever the list changes. */\n markedDays?: number[] | null | undefined;\n};\n\n/** Props of a `Gtk.LevelBar` element. */\ntype GtkLevelBarProps = {\n /** Offsets that split the bar's range into differently styled intervals. */\n offsets?: LevelBarOffset[] | null | undefined;\n};\n\n/** Props of a `Gtk.SizeGroup` element. */\ntype GtkSizeGroupProps = {\n /** Widgets the group keeps at a common size. */\n widgets?: Gtk.Widget[] | null | undefined;\n};\n\n/** Props of a `Gtk.AboutDialog` element. */\ntype GtkAboutDialogProps = {\n /**\n * Extra sections appended to the dialog's credits. GTK offers no way to remove one, so the list\n * cannot change once it has been applied.\n */\n creditSections?: CreditSection[] | null | undefined;\n};\n\n/** Props of a `Gtk.Application` element, whose `children` are the windows it owns. */\ntype GtkApplicationProps = {\n /** Accelerators bound to the application's actions. */\n actionAccels?: ActionAccel[] | null | undefined;\n /**\n * Command-line options the application parses, registered before it starts. GLib offers no way to\n * unregister one, so the list cannot change once it has been applied.\n */\n mainOptions?: MainOption[] | null | undefined;\n} & ChildrenProps;\n\n/** Props of a `Gtk.DropTarget` element. */\ntype GtkDropTargetProps = {\n /** GTypes the target accepts a drop of. */\n types?: GObject.Type[] | null | undefined;\n};\n\n/** Props of a `Gtk.DrawingArea` element. */\ntype GtkDrawingAreaProps = {\n /** Callback that draws the area's contents; setting it queues a redraw. */\n drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;\n};\n\n/** Props of a `Gtk.DragSource` element. */\ntype GtkDragSourceProps = {\n /** Icon shown under the pointer while a drag started from this source is in flight. */\n icon?: DragSourceIcon | null | undefined;\n};\n\nexport {\n type MenuItem,\n type VflConstraints,\n type ScaleMark,\n type LevelBarOffset,\n type CreditSection,\n type MainOption,\n type ActionAccel,\n type DragSourceIcon,\n type ChildrenProps,\n type GtkWidgetProps,\n type Style,\n type StyleProperties,\n type ActionGroupProps,\n type ActionMapProps,\n type MenuProps,\n type GtkShortcutControllerProps,\n type GtkOverlayProps,\n type GtkTextChildAnchorProps,\n type GtkConstraintLayoutProps,\n type GtkHeaderBarProps,\n type GtkScaleProps,\n type GtkCalendarProps,\n type GtkLevelBarProps,\n type GtkSizeGroupProps,\n type GtkAboutDialogProps,\n type GtkApplicationProps,\n type GtkDropTargetProps,\n type GtkDrawingAreaProps,\n type GtkDragSourceProps,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAmB,KAAK,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAiIpF,QAAA,MAAM,oBAAoB,GAAI,UAAU,MAAM,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAS1E,CAAC;AAqEF,QAAA,MAAM,SAAS,GAAI,MAAM,WAAW,KAAG,IAItC,CAAC;AAQF,QAAA,MAAM,cAAc,QAAO,IAI1B,CAAC;AAuCF,QAAA,MAAM,gBAAgB,QAAO,IAM5B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,IAO3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,MAAM,WAAW,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IASxE,CAAC;AAIF,QAAA,MAAM,iBAAiB,GAAI,QAAQ,YAAY,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAc3E,CAAC;AAEF,OAAO,EACH,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACvB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
2
|
+
import { coerceObjectProperty } from "@gtkx/runtime";
|
|
2
3
|
import { drain, isDeepEqual, kebabCase } from "@gtkx/utils";
|
|
3
4
|
import { applyAccessibleProps, isAccessibleProp } from "../utils/accessible-props.js";
|
|
4
5
|
import { typeInfoFor } from "./metadata.js";
|
|
@@ -30,7 +31,7 @@ const writeValue = (object, name, value) => {
|
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
applyWrite(() => {
|
|
33
|
-
Reflect.set(object, name, value);
|
|
34
|
+
Reflect.set(object, name, coerceObjectProperty(object, name, value));
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
37
|
const resetPlain = (object, info, name) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-props.js","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAoB,kBAAkB,EAAqB,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtG,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC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x/runtime\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { drain, isDeepEqual, kebabCase } from \"@gtkx/utils\";\nimport type { ElementBehavior, Props } from \"./registry.js\";\nimport { applyAccessibleProps, isAccessibleProp } from \"../utils/accessible-props.js\";\nimport { type TypeInfo, typeInfoFor } from \"./metadata.js\";\nimport { type ElementNode, getOrCreateContext, type SignalTarget } from \"./node.js\";\nimport { applyWrite, connectHandler, disconnectHandler } from \"./signals.js\";\nimport { bufferText, hasSameText, isContentPaintableProp, markTextDirty, TEXT_PROP } from \"./text.js\";\n\ntype PropDelta = { name: string; value: unknown; prevValue: unknown };\ntype BehaviorUpdateContext = { node: ElementNode; prev: Props; next: Props; consumed: Set<string> };\ntype PropChange = { prev: Props; next: Props };\n\nconst REACT_RESERVED_PROPS = new Set([\"children\", \"ref\", \"key\"]);\nconst NOTIFY_PREFIX = \"onNotify\";\nconst HANDLER_PREFIX = \"on\";\nconst HANDLER_NAME = /^on[A-Z]/;\nconst flushDirty: Set<ElementNode> = new Set();\nconst accessibleDirty: Map<ElementNode, Props> = new Map();\nconst mapWatched: WeakSet<ElementNode> = new WeakSet();\nconst pendingMap: Set<ElementNode> = new Set();\n\nconst isHandlerName = (name: string): boolean => HANDLER_NAME.test(name);\n\nconst signalForProp = (info: TypeInfo, name: string): string => {\n if (name === NOTIFY_PREFIX) {\n return \"notify\";\n }\n\n if (name.startsWith(NOTIFY_PREFIX) && name.length > NOTIFY_PREFIX.length) {\n return `notify::${kebabCase(name.slice(NOTIFY_PREFIX.length))}`;\n }\n\n return info.signals[name] ?? kebabCase(name.slice(HANDLER_PREFIX.length));\n};\n\nconst isReservedName = (name: string, info: TypeInfo): boolean =>\n REACT_RESERVED_PROPS.has(name) || isHandlerName(name) || isAccessibleProp(name) || info.constructOnly.has(name);\n\nconst isSkippedValueName = (name: string, info: TypeInfo, consumed: Set<string>): boolean =>\n isReservedName(name, info) || consumed.has(name);\n\nconst writeValue = (object: GObject.Object, name: string, value: unknown): void => {\n if (hasSameText(object, name, value)) {\n return;\n }\n\n applyWrite(() => {\n Reflect.set(object, name, value);\n });\n};\n\nconst resetPlain = (object: GObject.Object, info: TypeInfo, name: string): void => {\n if (Object.hasOwn(info.defaults, name)) {\n writeValue(object, name, info.defaults[name]);\n }\n};\n\nconst setOrReset = (object: GObject.Object, info: TypeInfo, name: string, value: unknown): void => {\n if (value === undefined) {\n resetPlain(object, info, name);\n } else {\n writeValue(object, name, value);\n }\n};\n\nconst applyBufferText = (buffer: Gtk.TextBuffer, text: string): void => {\n if (bufferText(buffer) === text) {\n return;\n }\n\n applyWrite(() => {\n buffer.beginIrreversibleAction();\n buffer.setText(text, -1);\n buffer.endIrreversibleAction();\n });\n};\n\nconst isBufferText = (node: ElementNode, name: string): node is ElementNode & { object: Gtk.TextBuffer } =>\n name === TEXT_PROP && node.contentKind === \"buffer\" && node.object instanceof Gtk.TextBuffer;\n\nconst propText = (value: unknown): string => (typeof value === \"string\" ? value : JSON.stringify(value));\n\nconst applyEntry = (node: ElementNode, info: TypeInfo, delta: PropDelta): void => {\n const { name, value, prevValue } = delta;\n\n if (value !== undefined && isBufferText(node, name)) {\n applyBufferText(node.object, propText(value));\n\n return;\n }\n\n if (isContentPaintableProp(node, name)) {\n markTextDirty(node);\n\n return;\n }\n\n const isInitialNull = value === null && prevValue === undefined;\n\n if (!isInitialNull) {\n setOrReset(node.object, info, name, value);\n }\n};\n\nconst eachChangedName = (prev: Props, next: Props, visit: (name: string) => void): void => {\n for (const name in prev) {\n visit(name);\n }\n\n for (const name in next) {\n if (!Object.hasOwn(prev, name)) {\n visit(name);\n }\n }\n};\n\nconst propChangeError = (typeName: string, name: string): Error =>\n new Error(\n `Cannot change the construct-only prop '${name}' of <${typeName}> after it is created. ` +\n \"It is only accepted while the element is being built, so give the element a key that \" +\n `changes with '${name}' and React will build a new one.`,\n );\n\nconst hasAppliedValue = (value: unknown): boolean => (Array.isArray(value) ? value.length > 0 : value !== undefined);\n\nconst isConstructOnlyChange = (info: TypeInfo, name: string, change: PropChange): boolean =>\n info.constructOnly.has(name) && !Object.is(change.prev[name], change.next[name]);\n\nconst isDeclaredConstructOnlyChange = (info: TypeInfo, name: string, change: PropChange): boolean =>\n info.declaredConstructOnly.has(name) &&\n hasAppliedValue(change.prev[name]) &&\n !isDeepEqual(change.prev[name], change.next[name]);\n\nconst assertPropsCanChange = (typeName: string, prev: Props, next: Props): void => {\n const info = typeInfoFor(typeName);\n const change: PropChange = { prev, next };\n\n eachChangedName(prev, next, (name) => {\n if (isConstructOnlyChange(info, name, change) || isDeclaredConstructOnlyChange(info, name, change)) {\n throw propChangeError(typeName, name);\n }\n });\n};\n\nconst collectConsumed = (ctx: BehaviorUpdateContext, behavior: ElementBehavior): void => {\n if (behavior.update === undefined) {\n return;\n }\n\n const result = behavior.update(ctx.node.object, ctx.prev, ctx.next, getOrCreateContext(ctx.node, behavior));\n\n if (result === undefined) {\n return;\n }\n\n for (const name of result) {\n ctx.consumed.add(name);\n }\n};\n\nconst runBehaviorUpdates = (node: ElementNode, info: TypeInfo, prev: Props, next: Props): Set<string> => {\n const consumed: Set<string> = new Set();\n const ctx: BehaviorUpdateContext = { node, prev, next, consumed };\n\n for (const behavior of info.behaviors) {\n collectConsumed(ctx, behavior);\n }\n\n return consumed;\n};\n\nconst applyValueEntries = (node: ElementNode, info: TypeInfo, change: PropChange, consumed: Set<string>): void => {\n eachChangedName(change.prev, change.next, (name) => {\n if (isSkippedValueName(name, info, consumed) || Object.is(change.prev[name], change.next[name])) {\n return;\n }\n\n applyEntry(node, info, { name, value: change.next[name], prevValue: change.prev[name] });\n });\n};\n\nconst restoreActionableSensitivity = (node: ElementNode, info: TypeInfo, prev: Props, next: Props): void => {\n if (prev.actionName === undefined || next.actionName !== undefined) {\n return;\n }\n\n const desired = \"sensitive\" in next ? next.sensitive : info.defaults.sensitive;\n\n if (typeof desired === \"boolean\") {\n applyWrite(() => {\n Reflect.set(node.object, \"sensitive\", desired);\n });\n }\n};\n\nconst applyHandlers = (target: SignalTarget, info: TypeInfo, prev: Props, next: Props): void => {\n eachChangedName(prev, next, (name) => {\n if (!isHandlerName(name)) {\n return;\n }\n\n const value = next[name];\n\n if (typeof value === \"function\") {\n connectHandler(target, name, signalForProp(info, name), value as SignalHandler);\n } else {\n disconnectHandler(target, name);\n }\n });\n};\n\nconst markFlush = (node: ElementNode): void => {\n if (typeInfoFor(node.typeName).hasFlush) {\n flushDirty.add(node);\n }\n};\n\nconst eachBehavior = (node: ElementNode, visit: (behavior: ElementBehavior, context: unknown) => void): void => {\n for (const behavior of typeInfoFor(node.typeName).behaviors) {\n visit(behavior, getOrCreateContext(node, behavior));\n }\n};\n\nconst flushBehaviors = (): void => {\n drain(flushDirty, (node) => {\n eachBehavior(node, (behavior, context) => behavior.flush?.(node.object, context));\n });\n};\n\nconst applyAccessible = (object: GObject.Object, prev: Props | null, next: Props): void => {\n if (object instanceof Gtk.Accessible) {\n applyAccessibleProps(object, prev, next);\n }\n};\n\nconst markAccessible = (node: ElementNode, prev: Props): void => {\n if (!accessibleDirty.has(node)) {\n accessibleDirty.set(node, prev);\n }\n};\n\nconst hasAccessibleProp = (props: Props): boolean => {\n for (const name in props) {\n if (isAccessibleProp(name)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst watchMap = (node: ElementNode): void => {\n const { object } = node;\n\n if (mapWatched.has(node) || !(object instanceof Gtk.Widget) || !hasAccessibleProp(node.props)) {\n return;\n }\n\n mapWatched.add(node);\n\n object.connect(\"map\", () => {\n pendingMap.add(node);\n setTimeout(settleAccessible, 0);\n });\n};\n\nconst settleAccessible = (): void => {\n drain(pendingMap, (node) => {\n if (node.object instanceof Gtk.Widget && node.object.getMapped()) {\n applyAccessible(node.object, null, node.props);\n }\n });\n};\n\nconst flushAccessible = (): void => {\n for (const [node, prev] of accessibleDirty) {\n applyAccessible(node.object, prev, node.props);\n watchMap(node);\n }\n\n accessibleDirty.clear();\n};\n\nconst applyElementProps = (node: ElementNode, prev: Props, next: Props): void => {\n const info = typeInfoFor(node.typeName);\n const consumed = runBehaviorUpdates(node, info, prev, next);\n applyValueEntries(node, info, { prev, next }, consumed);\n restoreActionableSensitivity(node, info, prev, next);\n applyHandlers(node, info, prev, next);\n markAccessible(node, prev);\n markFlush(node);\n node.props = next;\n};\n\nconst isSkippedAdoptedName = (info: TypeInfo, name: string): boolean => isReservedName(name, info);\n\nconst applyAdoptedProps = (target: SignalTarget, prev: Props, next: Props): void => {\n const { object, typeName } = target;\n const info = typeInfoFor(typeName);\n\n eachChangedName(prev, next, (name) => {\n if (isSkippedAdoptedName(info, name) || Object.is(prev[name], next[name])) {\n return;\n }\n\n setOrReset(object, info, name, next[name]);\n });\n\n applyAccessible(object, prev, next);\n applyHandlers(target, info, prev, next);\n};\n\nexport {\n markFlush,\n flushAccessible,\n settleAccessible,\n flushBehaviors,\n applyElementProps,\n applyAdoptedProps,\n assertPropsCanChange,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"apply-props.js","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAoB,kBAAkB,EAAqB,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtG,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EA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esContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { coerceObjectProperty } from \"@gtkx/runtime\";\nimport { drain, isDeepEqual, kebabCase } from \"@gtkx/utils\";\nimport type { ElementBehavior, Props } from \"./registry.js\";\nimport { applyAccessibleProps, isAccessibleProp } from \"../utils/accessible-props.js\";\nimport { type TypeInfo, typeInfoFor } from \"./metadata.js\";\nimport { type ElementNode, getOrCreateContext, type SignalTarget } from \"./node.js\";\nimport { applyWrite, connectHandler, disconnectHandler } from \"./signals.js\";\nimport { bufferText, hasSameText, isContentPaintableProp, markTextDirty, TEXT_PROP } from \"./text.js\";\n\ntype PropDelta = { name: string; value: unknown; prevValue: unknown };\ntype BehaviorUpdateContext = { node: ElementNode; prev: Props; next: Props; consumed: Set<string> };\ntype PropChange = { prev: Props; next: Props };\n\nconst REACT_RESERVED_PROPS = new Set([\"children\", \"ref\", \"key\"]);\nconst NOTIFY_PREFIX = \"onNotify\";\nconst HANDLER_PREFIX = \"on\";\nconst HANDLER_NAME = /^on[A-Z]/;\nconst flushDirty: Set<ElementNode> = new Set();\nconst accessibleDirty: Map<ElementNode, Props> = new Map();\nconst mapWatched: WeakSet<ElementNode> = new WeakSet();\nconst pendingMap: Set<ElementNode> = new Set();\n\nconst isHandlerName = (name: string): boolean => HANDLER_NAME.test(name);\n\nconst signalForProp = (info: TypeInfo, name: string): string => {\n if (name === NOTIFY_PREFIX) {\n return \"notify\";\n }\n\n if (name.startsWith(NOTIFY_PREFIX) && name.length > NOTIFY_PREFIX.length) {\n return `notify::${kebabCase(name.slice(NOTIFY_PREFIX.length))}`;\n }\n\n return info.signals[name] ?? kebabCase(name.slice(HANDLER_PREFIX.length));\n};\n\nconst isReservedName = (name: string, info: TypeInfo): boolean =>\n REACT_RESERVED_PROPS.has(name) || isHandlerName(name) || isAccessibleProp(name) || info.constructOnly.has(name);\n\nconst isSkippedValueName = (name: string, info: TypeInfo, consumed: Set<string>): boolean =>\n isReservedName(name, info) || consumed.has(name);\n\nconst writeValue = (object: GObject.Object, name: string, value: unknown): void => {\n if (hasSameText(object, name, value)) {\n return;\n }\n\n applyWrite(() => {\n Reflect.set(object, name, coerceObjectProperty(object, name, value));\n });\n};\n\nconst resetPlain = (object: GObject.Object, info: TypeInfo, name: string): void => {\n if (Object.hasOwn(info.defaults, name)) {\n writeValue(object, name, info.defaults[name]);\n }\n};\n\nconst setOrReset = (object: GObject.Object, info: TypeInfo, name: string, value: unknown): void => {\n if (value === undefined) {\n resetPlain(object, info, name);\n } else {\n writeValue(object, name, value);\n }\n};\n\nconst applyBufferText = (buffer: Gtk.TextBuffer, text: string): void => {\n if (bufferText(buffer) === text) {\n return;\n }\n\n applyWrite(() => {\n buffer.beginIrreversibleAction();\n buffer.setText(text, -1);\n buffer.endIrreversibleAction();\n });\n};\n\nconst isBufferText = (node: ElementNode, name: string): node is ElementNode & { object: Gtk.TextBuffer } =>\n name === TEXT_PROP && node.contentKind === \"buffer\" && node.object instanceof Gtk.TextBuffer;\n\nconst propText = (value: unknown): string => (typeof value === \"string\" ? value : JSON.stringify(value));\n\nconst applyEntry = (node: ElementNode, info: TypeInfo, delta: PropDelta): void => {\n const { name, value, prevValue } = delta;\n\n if (value !== undefined && isBufferText(node, name)) {\n applyBufferText(node.object, propText(value));\n\n return;\n }\n\n if (isContentPaintableProp(node, name)) {\n markTextDirty(node);\n\n return;\n }\n\n const isInitialNull = value === null && prevValue === undefined;\n\n if (!isInitialNull) {\n setOrReset(node.object, info, name, value);\n }\n};\n\nconst eachChangedName = (prev: Props, next: Props, visit: (name: string) => void): void => {\n for (const name in prev) {\n visit(name);\n }\n\n for (const name in next) {\n if (!Object.hasOwn(prev, name)) {\n visit(name);\n }\n }\n};\n\nconst propChangeError = (typeName: string, name: string): Error =>\n new Error(\n `Cannot change the construct-only prop '${name}' of <${typeName}> after it is created. ` +\n \"It is only accepted while the element is being built, so give the element a key that \" +\n `changes with '${name}' and React will build a new one.`,\n );\n\nconst hasAppliedValue = (value: unknown): boolean => (Array.isArray(value) ? value.length > 0 : value !== undefined);\n\nconst isConstructOnlyChange = (info: TypeInfo, name: string, change: PropChange): boolean =>\n info.constructOnly.has(name) && !Object.is(change.prev[name], change.next[name]);\n\nconst isDeclaredConstructOnlyChange = (info: TypeInfo, name: string, change: PropChange): boolean =>\n info.declaredConstructOnly.has(name) &&\n hasAppliedValue(change.prev[name]) &&\n !isDeepEqual(change.prev[name], change.next[name]);\n\nconst assertPropsCanChange = (typeName: string, prev: Props, next: Props): void => {\n const info = typeInfoFor(typeName);\n const change: PropChange = { prev, next };\n\n eachChangedName(prev, next, (name) => {\n if (isConstructOnlyChange(info, name, change) || isDeclaredConstructOnlyChange(info, name, change)) {\n throw propChangeError(typeName, name);\n }\n });\n};\n\nconst collectConsumed = (ctx: BehaviorUpdateContext, behavior: ElementBehavior): void => {\n if (behavior.update === undefined) {\n return;\n }\n\n const result = behavior.update(ctx.node.object, ctx.prev, ctx.next, getOrCreateContext(ctx.node, behavior));\n\n if (result === undefined) {\n return;\n }\n\n for (const name of result) {\n ctx.consumed.add(name);\n }\n};\n\nconst runBehaviorUpdates = (node: ElementNode, info: TypeInfo, prev: Props, next: Props): Set<string> => {\n const consumed: Set<string> = new Set();\n const ctx: BehaviorUpdateContext = { node, prev, next, consumed };\n\n for (const behavior of info.behaviors) {\n collectConsumed(ctx, behavior);\n }\n\n return consumed;\n};\n\nconst applyValueEntries = (node: ElementNode, info: TypeInfo, change: PropChange, consumed: Set<string>): void => {\n eachChangedName(change.prev, change.next, (name) => {\n if (isSkippedValueName(name, info, consumed) || Object.is(change.prev[name], change.next[name])) {\n return;\n }\n\n applyEntry(node, info, { name, value: change.next[name], prevValue: change.prev[name] });\n });\n};\n\nconst restoreActionableSensitivity = (node: ElementNode, info: TypeInfo, prev: Props, next: Props): void => {\n if (prev.actionName === undefined || next.actionName !== undefined) {\n return;\n }\n\n const desired = \"sensitive\" in next ? next.sensitive : info.defaults.sensitive;\n\n if (typeof desired === \"boolean\") {\n applyWrite(() => {\n Reflect.set(node.object, \"sensitive\", desired);\n });\n }\n};\n\nconst applyHandlers = (target: SignalTarget, info: TypeInfo, prev: Props, next: Props): void => {\n eachChangedName(prev, next, (name) => {\n if (!isHandlerName(name)) {\n return;\n }\n\n const value = next[name];\n\n if (typeof value === \"function\") {\n connectHandler(target, name, signalForProp(info, name), value as SignalHandler);\n } else {\n disconnectHandler(target, name);\n }\n });\n};\n\nconst markFlush = (node: ElementNode): void => {\n if (typeInfoFor(node.typeName).hasFlush) {\n flushDirty.add(node);\n }\n};\n\nconst eachBehavior = (node: ElementNode, visit: (behavior: ElementBehavior, context: unknown) => void): void => {\n for (const behavior of typeInfoFor(node.typeName).behaviors) {\n visit(behavior, getOrCreateContext(node, behavior));\n }\n};\n\nconst flushBehaviors = (): void => {\n drain(flushDirty, (node) => {\n eachBehavior(node, (behavior, context) => behavior.flush?.(node.object, context));\n });\n};\n\nconst applyAccessible = (object: GObject.Object, prev: Props | null, next: Props): void => {\n if (object instanceof Gtk.Accessible) {\n applyAccessibleProps(object, prev, next);\n }\n};\n\nconst markAccessible = (node: ElementNode, prev: Props): void => {\n if (!accessibleDirty.has(node)) {\n accessibleDirty.set(node, prev);\n }\n};\n\nconst hasAccessibleProp = (props: Props): boolean => {\n for (const name in props) {\n if (isAccessibleProp(name)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst watchMap = (node: ElementNode): void => {\n const { object } = node;\n\n if (mapWatched.has(node) || !(object instanceof Gtk.Widget) || !hasAccessibleProp(node.props)) {\n return;\n }\n\n mapWatched.add(node);\n\n object.connect(\"map\", () => {\n pendingMap.add(node);\n setTimeout(settleAccessible, 0);\n });\n};\n\nconst settleAccessible = (): void => {\n drain(pendingMap, (node) => {\n if (node.object instanceof Gtk.Widget && node.object.getMapped()) {\n applyAccessible(node.object, null, node.props);\n }\n });\n};\n\nconst flushAccessible = (): void => {\n for (const [node, prev] of accessibleDirty) {\n applyAccessible(node.object, prev, node.props);\n watchMap(node);\n }\n\n accessibleDirty.clear();\n};\n\nconst applyElementProps = (node: ElementNode, prev: Props, next: Props): void => {\n const info = typeInfoFor(node.typeName);\n const consumed = runBehaviorUpdates(node, info, prev, next);\n applyValueEntries(node, info, { prev, next }, consumed);\n restoreActionableSensitivity(node, info, prev, next);\n applyHandlers(node, info, prev, next);\n markAccessible(node, prev);\n markFlush(node);\n node.props = next;\n};\n\nconst isSkippedAdoptedName = (info: TypeInfo, name: string): boolean => isReservedName(name, info);\n\nconst applyAdoptedProps = (target: SignalTarget, prev: Props, next: Props): void => {\n const { object, typeName } = target;\n const info = typeInfoFor(typeName);\n\n eachChangedName(prev, next, (name) => {\n if (isSkippedAdoptedName(info, name) || Object.is(prev[name], next[name])) {\n return;\n }\n\n setOrReset(object, info, name, next[name]);\n });\n\n applyAccessible(object, prev, next);\n applyHandlers(target, info, prev, next);\n};\n\nexport {\n markFlush,\n flushAccessible,\n settleAccessible,\n flushBehaviors,\n applyElementProps,\n applyAdoptedProps,\n assertPropsCanChange,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-config.d.ts","sourceRoot":"","sources":["../../src/reconciler/host-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAKjD,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAc/C,OAAO,EAOH,KAAK,QAAQ,EAGb,KAAK,QAAQ,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"host-config.d.ts","sourceRoot":"","sources":["../../src/reconciler/host-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAKjD,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAc/C,OAAO,EAOH,KAAK,QAAQ,EAGb,KAAK,QAAQ,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWpE,+GAA+G;AAC/G,KAAK,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;AA2H9C,QAAA,MAAM,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CACrE,CAAC;AAwGhC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { resolveElementNode } from "./instance.js";
|
|
|
12
12
|
import { createElementNode, createPropNode, createTextNode, ELEMENT_KIND, LAZY_KIND, lazyTarget, } from "./node.js";
|
|
13
13
|
import { isRootElement } from "./root-element.js";
|
|
14
14
|
import { disconnectAllHandlers } from "./signals.js";
|
|
15
|
+
import { releaseStyle } from "./style.js";
|
|
15
16
|
import { didUpdateTextSurgically, enclosingHost, flushTextHosts, markTextDirty, validateContentMix, } from "./text.js";
|
|
16
17
|
const RENDERER_VERSION = packageManifest.version;
|
|
17
18
|
const HOST_CONTEXT = {};
|
|
@@ -94,7 +95,7 @@ const hostConfig = {
|
|
|
94
95
|
unhideTextInstance: () => undefined,
|
|
95
96
|
detachDeletedInstance: (instance) => {
|
|
96
97
|
if (instance.kind === ELEMENT_KIND) {
|
|
97
|
-
|
|
98
|
+
detachElement(instance);
|
|
98
99
|
}
|
|
99
100
|
else if (instance.kind === LAZY_KIND && instance.adopted !== null) {
|
|
100
101
|
disconnectAllHandlers(lazyTarget(instance, instance.adopted));
|
|
@@ -144,6 +145,12 @@ function createPriorityTracker() {
|
|
|
144
145
|
},
|
|
145
146
|
};
|
|
146
147
|
}
|
|
148
|
+
const detachElement = (instance) => {
|
|
149
|
+
disconnectAllHandlers(instance);
|
|
150
|
+
if (instance.object instanceof Gtk.Widget) {
|
|
151
|
+
releaseStyle(instance.object);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
147
154
|
const updateInstance = (instance, prev, next) => {
|
|
148
155
|
if (instance.kind === ELEMENT_KIND) {
|
|
149
156
|
assertPropsCanChange(instance.typeName, prev, next);
|