@gtkx/codegen 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/descriptor-render.d.ts +18 -11
- package/dist/analysis/descriptor-render.d.ts.map +1 -1
- package/dist/analysis/descriptor-render.js +275 -152
- package/dist/analysis/descriptor-render.js.map +1 -1
- package/dist/analysis/descriptor.d.ts +37 -34
- package/dist/analysis/descriptor.d.ts.map +1 -1
- package/dist/analysis/descriptor.js +34 -30
- package/dist/analysis/descriptor.js.map +1 -1
- package/dist/analysis/inheritance.d.ts +16 -16
- package/dist/analysis/inheritance.d.ts.map +1 -1
- package/dist/analysis/inheritance.js +139 -84
- package/dist/analysis/inheritance.js.map +1 -1
- package/dist/analysis/param-structure.d.ts +14 -13
- package/dist/analysis/param-structure.d.ts.map +1 -1
- package/dist/analysis/param-structure.js +104 -53
- package/dist/analysis/param-structure.js.map +1 -1
- package/dist/analysis/ts-type.d.ts +6 -5
- package/dist/analysis/ts-type.d.ts.map +1 -1
- package/dist/analysis/ts-type.js +69 -23
- package/dist/analysis/ts-type.js.map +1 -1
- package/dist/compile.d.ts +5 -5
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +70 -63
- package/dist/compile.js.map +1 -1
- package/dist/docs/api-reference.d.ts +12 -11
- package/dist/docs/api-reference.d.ts.map +1 -1
- package/dist/docs/api-reference.js +194 -121
- package/dist/docs/api-reference.js.map +1 -1
- package/dist/docs/element-page.d.ts +6 -9
- package/dist/docs/element-page.d.ts.map +1 -1
- package/dist/docs/element-page.js +68 -133
- package/dist/docs/element-page.js.map +1 -1
- package/dist/docs/pipeline.d.ts +8 -7
- package/dist/docs/pipeline.d.ts.map +1 -1
- package/dist/docs/pipeline.js +79 -53
- package/dist/docs/pipeline.js.map +1 -1
- package/dist/docs/render.d.ts +21 -19
- package/dist/docs/render.d.ts.map +1 -1
- package/dist/docs/render.js +80 -71
- package/dist/docs/render.js.map +1 -1
- package/dist/docs/symbol-page.d.ts +6 -6
- package/dist/docs/symbol-page.d.ts.map +1 -1
- package/dist/docs/symbol-page.js +126 -84
- package/dist/docs/symbol-page.js.map +1 -1
- package/dist/fingerprint.d.ts +28 -5
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +66 -13
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts +13 -0
- package/dist/gi.d.ts.map +1 -0
- package/dist/gi.js +21 -0
- package/dist/gi.js.map +1 -0
- package/dist/gir/ancestry.d.ts +4 -3
- package/dist/gir/ancestry.d.ts.map +1 -1
- package/dist/gir/ancestry.js +12 -15
- package/dist/gir/ancestry.js.map +1 -1
- package/dist/gir/callback.d.ts +6 -11
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +6 -7
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +7 -5
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +14 -12
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/enum.d.ts +3 -3
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +7 -6
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +8 -3
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +30 -7
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +6 -3
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +23 -7
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/gir-path.d.ts +2 -1
- package/dist/gir/gir-path.d.ts.map +1 -1
- package/dist/gir/gir-path.js +26 -10
- package/dist/gir/gir-path.js.map +1 -1
- package/dist/gir/libraries.d.ts +3 -2
- package/dist/gir/libraries.d.ts.map +1 -1
- package/dist/gir/libraries.js +39 -27
- package/dist/gir/libraries.js.map +1 -1
- package/dist/gir/library.d.ts +17 -11
- package/dist/gir/library.d.ts.map +1 -1
- package/dist/gir/library.js +116 -92
- package/dist/gir/library.js.map +1 -1
- package/dist/gir/namespace.d.ts +10 -10
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +21 -20
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/nullable-overrides.d.ts +3 -0
- package/dist/gir/nullable-overrides.d.ts.map +1 -0
- package/dist/gir/nullable-overrides.js +5 -0
- package/dist/gir/nullable-overrides.js.map +1 -0
- package/dist/gir/parameter.d.ts +14 -12
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +27 -18
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +12 -13
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +50 -40
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +5 -4
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js +4 -3
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +5 -4
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +10 -9
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +5 -4
- package/dist/gir/record.d.ts.map +1 -1
- package/dist/gir/record.js +13 -12
- package/dist/gir/record.js.map +1 -1
- package/dist/gir/size.d.ts +6 -5
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js +49 -47
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +17 -15
- package/dist/gir/type-id.d.ts.map +1 -1
- package/dist/gir/type-id.js +5 -1
- package/dist/gir/type-id.js.map +1 -1
- package/dist/gir/type-ref.d.ts +3 -2
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +36 -25
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +3 -2
- package/dist/gir/type.d.ts.map +1 -1
- package/dist/gir/type.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx.d.ts +26 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/jsx.js +40 -0
- package/dist/jsx.js.map +1 -0
- package/dist/khronos/args.d.ts +7 -7
- package/dist/khronos/args.d.ts.map +1 -1
- package/dist/khronos/args.js +88 -67
- package/dist/khronos/args.js.map +1 -1
- package/dist/khronos/jsdoc.d.ts +4 -4
- package/dist/khronos/jsdoc.d.ts.map +1 -1
- package/dist/khronos/jsdoc.js +29 -16
- package/dist/khronos/jsdoc.js.map +1 -1
- package/dist/khronos/model.d.ts +8 -7
- package/dist/khronos/model.d.ts.map +1 -1
- package/dist/khronos/model.js +94 -59
- package/dist/khronos/model.js.map +1 -1
- package/dist/khronos/modules.d.ts +4 -3
- package/dist/khronos/modules.d.ts.map +1 -1
- package/dist/khronos/modules.js +40 -25
- package/dist/khronos/modules.js.map +1 -1
- package/dist/khronos/param-pair.d.ts +11 -0
- package/dist/khronos/param-pair.d.ts.map +1 -0
- package/dist/khronos/param-pair.js +6 -0
- package/dist/khronos/param-pair.js.map +1 -0
- package/dist/khronos/parse.d.ts +7 -8
- package/dist/khronos/parse.d.ts.map +1 -1
- package/dist/khronos/parse.js +17 -16
- package/dist/khronos/parse.js.map +1 -1
- package/dist/khronos/pipeline.d.ts +4 -4
- package/dist/khronos/pipeline.d.ts.map +1 -1
- package/dist/khronos/pipeline.js +97 -56
- package/dist/khronos/pipeline.js.map +1 -1
- package/dist/khronos/plan.d.ts +11 -10
- package/dist/khronos/plan.d.ts.map +1 -1
- package/dist/khronos/plan.js +109 -45
- package/dist/khronos/plan.js.map +1 -1
- package/dist/khronos/render.d.ts +5 -4
- package/dist/khronos/render.d.ts.map +1 -1
- package/dist/khronos/render.js +106 -59
- package/dist/khronos/render.js.map +1 -1
- package/dist/khronos/select.d.ts +4 -4
- package/dist/khronos/select.d.ts.map +1 -1
- package/dist/khronos/select.js +30 -19
- package/dist/khronos/select.js.map +1 -1
- package/dist/react/element-config.d.ts +17 -0
- package/dist/react/element-config.d.ts.map +1 -0
- package/dist/react/element-config.js +61 -0
- package/dist/react/element-config.js.map +1 -0
- package/dist/runner.d.ts +17 -10
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +45 -43
- package/dist/runner.js.map +1 -1
- package/dist/store/compile-store.d.ts +5 -3
- package/dist/store/compile-store.d.ts.map +1 -1
- package/dist/store/compile-store.js +24 -22
- package/dist/store/compile-store.js.map +1 -1
- package/dist/store/gi/async.d.ts +2 -1
- package/dist/store/gi/async.d.ts.map +1 -1
- package/dist/store/gi/async.js +28 -24
- package/dist/store/gi/async.js.map +1 -1
- package/dist/store/gi/callables.d.ts +26 -20
- package/dist/store/gi/callables.d.ts.map +1 -1
- package/dist/store/gi/callables.js +162 -100
- package/dist/store/gi/callables.js.map +1 -1
- package/dist/store/gi/callback.d.ts +3 -2
- package/dist/store/gi/callback.d.ts.map +1 -1
- package/dist/store/gi/callback.js +6 -3
- package/dist/store/gi/callback.js.map +1 -1
- package/dist/store/gi/class-struct-record.d.ts +4 -3
- package/dist/store/gi/class-struct-record.d.ts.map +1 -1
- package/dist/store/gi/class-struct-record.js +33 -15
- package/dist/store/gi/class-struct-record.js.map +1 -1
- package/dist/store/gi/class.d.ts +2 -1
- package/dist/store/gi/class.d.ts.map +1 -1
- package/dist/store/gi/class.js +86 -47
- package/dist/store/gi/class.js.map +1 -1
- package/dist/store/gi/companion.d.ts +2 -1
- package/dist/store/gi/companion.d.ts.map +1 -1
- package/dist/store/gi/companion.js +8 -5
- package/dist/store/gi/companion.js.map +1 -1
- package/dist/store/gi/constant.d.ts +3 -2
- package/dist/store/gi/constant.d.ts.map +1 -1
- package/dist/store/gi/constant.js +25 -8
- package/dist/store/gi/constant.js.map +1 -1
- package/dist/store/gi/constructor-props.d.ts +3 -2
- package/dist/store/gi/constructor-props.d.ts.map +1 -1
- package/dist/store/gi/constructor-props.js +17 -10
- package/dist/store/gi/constructor-props.js.map +1 -1
- package/dist/store/gi/enum.d.ts +3 -2
- package/dist/store/gi/enum.d.ts.map +1 -1
- package/dist/store/gi/enum.js +14 -11
- package/dist/store/gi/enum.js.map +1 -1
- package/dist/store/gi/function.d.ts +5 -4
- package/dist/store/gi/function.d.ts.map +1 -1
- package/dist/store/gi/function.js +50 -23
- package/dist/store/gi/function.js.map +1 -1
- package/dist/store/gi/gtype-binding.d.ts +4 -4
- package/dist/store/gi/gtype-binding.d.ts.map +1 -1
- package/dist/store/gi/gtype-binding.js +15 -11
- package/dist/store/gi/gtype-binding.js.map +1 -1
- package/dist/store/gi/interface.d.ts +2 -1
- package/dist/store/gi/interface.d.ts.map +1 -1
- package/dist/store/gi/interface.js +36 -18
- package/dist/store/gi/interface.js.map +1 -1
- package/dist/store/gi/item-comparators.d.ts +3 -2
- package/dist/store/gi/item-comparators.d.ts.map +1 -1
- package/dist/store/gi/item-comparators.js +33 -21
- package/dist/store/gi/item-comparators.js.map +1 -1
- package/dist/store/gi/method.d.ts +13 -13
- package/dist/store/gi/method.d.ts.map +1 -1
- package/dist/store/gi/method.js +187 -130
- package/dist/store/gi/method.js.map +1 -1
- package/dist/store/gi/param-marshal.d.ts +7 -6
- package/dist/store/gi/param-marshal.d.ts.map +1 -1
- package/dist/store/gi/param-marshal.js +26 -13
- package/dist/store/gi/param-marshal.js.map +1 -1
- package/dist/store/gi/pipeline.d.ts +2 -1
- package/dist/store/gi/pipeline.d.ts.map +1 -1
- package/dist/store/gi/pipeline.js +38 -23
- package/dist/store/gi/pipeline.js.map +1 -1
- package/dist/store/gi/properties.d.ts +2 -1
- package/dist/store/gi/properties.d.ts.map +1 -1
- package/dist/store/gi/properties.js +6 -4
- package/dist/store/gi/properties.js.map +1 -1
- package/dist/store/gi/property-accessor.d.ts +11 -10
- package/dist/store/gi/property-accessor.d.ts.map +1 -1
- package/dist/store/gi/property-accessor.js +86 -60
- package/dist/store/gi/property-accessor.js.map +1 -1
- package/dist/store/gi/record-constructor.d.ts +3 -2
- package/dist/store/gi/record-constructor.d.ts.map +1 -1
- package/dist/store/gi/record-constructor.js +36 -25
- package/dist/store/gi/record-constructor.js.map +1 -1
- package/dist/store/gi/record-field-accessor.d.ts +8 -8
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
- package/dist/store/gi/record-field-accessor.js +171 -99
- package/dist/store/gi/record-field-accessor.js.map +1 -1
- package/dist/store/gi/record-layout.d.ts +6 -5
- package/dist/store/gi/record-layout.d.ts.map +1 -1
- package/dist/store/gi/record-layout.js +75 -39
- package/dist/store/gi/record-layout.js.map +1 -1
- package/dist/store/gi/record.d.ts +2 -1
- package/dist/store/gi/record.d.ts.map +1 -1
- package/dist/store/gi/record.js +19 -13
- package/dist/store/gi/record.js.map +1 -1
- package/dist/store/gi/registration.d.ts +3 -3
- package/dist/store/gi/registration.d.ts.map +1 -1
- package/dist/store/gi/registration.js +3 -2
- package/dist/store/gi/registration.js.map +1 -1
- package/dist/store/gi/return-wrap.d.ts +2 -2
- package/dist/store/gi/return-wrap.d.ts.map +1 -1
- package/dist/store/gi/return-wrap.js +43 -22
- package/dist/store/gi/return-wrap.js.map +1 -1
- package/dist/store/gi/runtime-override.d.ts +2 -1
- package/dist/store/gi/runtime-override.d.ts.map +1 -1
- package/dist/store/gi/runtime-override.js +6 -3
- package/dist/store/gi/runtime-override.js.map +1 -1
- package/dist/store/gi/signal.d.ts +3 -2
- package/dist/store/gi/signal.d.ts.map +1 -1
- package/dist/store/gi/signal.js +113 -66
- package/dist/store/gi/signal.js.map +1 -1
- package/dist/store/gi/vtable.d.ts +2 -1
- package/dist/store/gi/vtable.d.ts.map +1 -1
- package/dist/store/gi/vtable.js +60 -30
- package/dist/store/gi/vtable.js.map +1 -1
- package/dist/store/gi-store.d.ts +5 -4
- package/dist/store/gi-store.d.ts.map +1 -1
- package/dist/store/gi-store.js +4 -2
- package/dist/store/gi-store.js.map +1 -1
- package/dist/store/jsx/element-components.d.ts +23 -0
- package/dist/store/jsx/element-components.d.ts.map +1 -0
- package/dist/store/jsx/element-components.js +86 -0
- package/dist/store/jsx/element-components.js.map +1 -0
- package/dist/store/jsx/element-prop-imports.d.ts +17 -0
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-imports.js +15 -0
- package/dist/store/jsx/element-prop-imports.js.map +1 -0
- package/dist/store/jsx/element-prop-types.d.ts +10 -0
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-types.js +41 -0
- package/dist/store/jsx/element-prop-types.js.map +1 -0
- package/dist/store/jsx/gir-index.d.ts +16 -0
- package/dist/store/jsx/gir-index.d.ts.map +1 -0
- package/dist/store/jsx/gir-index.js +33 -0
- package/dist/store/jsx/gir-index.js.map +1 -0
- package/dist/store/jsx/intrinsic-elements.d.ts +27 -0
- package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -0
- package/dist/store/jsx/intrinsic-elements.js +128 -0
- package/dist/store/jsx/intrinsic-elements.js.map +1 -0
- package/dist/store/{react → jsx}/jsx.d.ts +2 -4
- package/dist/store/jsx/jsx.d.ts.map +1 -0
- package/dist/store/{react → jsx}/jsx.js +110 -71
- package/dist/store/jsx/jsx.js.map +1 -0
- package/dist/store/jsx/metadata.d.ts +4 -0
- package/dist/store/jsx/metadata.d.ts.map +1 -0
- package/dist/store/{react → jsx}/metadata.js +148 -69
- package/dist/store/jsx/metadata.js.map +1 -0
- package/dist/store/jsx/pipeline.d.ts +21 -0
- package/dist/store/jsx/pipeline.d.ts.map +1 -0
- package/dist/store/{react → jsx}/pipeline.js +36 -15
- package/dist/store/jsx/pipeline.js.map +1 -0
- package/dist/store/{react → jsx}/props.d.ts +9 -12
- package/dist/store/jsx/props.d.ts.map +1 -0
- package/dist/store/jsx/props.js +158 -0
- package/dist/store/jsx/props.js.map +1 -0
- package/dist/store/jsx-store.d.ts +5 -3
- package/dist/store/jsx-store.d.ts.map +1 -1
- package/dist/store/jsx-store.js +4 -1
- package/dist/store/jsx-store.js.map +1 -1
- package/dist/store/store-fs.d.ts +14 -12
- package/dist/store/store-fs.d.ts.map +1 -1
- package/dist/store/store-fs.js +9 -7
- package/dist/store/store-fs.js.map +1 -1
- package/dist/writer/context.d.ts +2 -1
- package/dist/writer/context.d.ts.map +1 -1
- package/dist/writer/context.js +12 -6
- package/dist/writer/context.js.map +1 -1
- package/dist/writer/doc.d.ts +2 -1
- package/dist/writer/doc.d.ts.map +1 -1
- package/dist/writer/doc.js +13 -7
- package/dist/writer/doc.js.map +1 -1
- package/dist/writer/emit.d.ts +8 -7
- package/dist/writer/emit.d.ts.map +1 -1
- package/dist/writer/emit.js +13 -10
- package/dist/writer/emit.js.map +1 -1
- package/dist/writer/gtk-doc.d.ts +2 -1
- package/dist/writer/gtk-doc.d.ts.map +1 -1
- package/dist/writer/gtk-doc.js +29 -18
- package/dist/writer/gtk-doc.js.map +1 -1
- package/dist/writer/imports.d.ts +4 -2
- package/dist/writer/imports.d.ts.map +1 -1
- package/dist/writer/imports.js +35 -24
- package/dist/writer/imports.js.map +1 -1
- package/dist/writer/module.d.ts +3 -2
- package/dist/writer/module.d.ts.map +1 -1
- package/dist/writer/module.js +16 -9
- package/dist/writer/module.js.map +1 -1
- package/dist/xml.d.ts +4 -0
- package/dist/xml.d.ts.map +1 -0
- package/dist/xml.js +10 -0
- package/dist/xml.js.map +1 -0
- package/overrides/cairo/context.ts.ejs +7 -7
- package/overrides/cairo/matrix.ts.ejs +2 -2
- package/overrides/cairo/recording-surface.ts.ejs +2 -2
- package/overrides/cairo/region.ts.ejs +1 -1
- package/overrides/cairo/scaled-font.ts.ejs +3 -3
- package/package.json +15 -9
- package/src/analysis/descriptor-render.ts +484 -168
- package/src/analysis/descriptor.ts +162 -125
- package/src/analysis/inheritance.ts +286 -98
- package/src/analysis/param-structure.ts +188 -57
- package/src/analysis/ts-type.ts +112 -26
- package/src/compile.ts +103 -76
- package/src/docs/api-reference.ts +340 -144
- package/src/docs/element-page.ts +137 -146
- package/src/docs/pipeline.ts +132 -73
- package/src/docs/render.ts +151 -87
- package/src/docs/symbol-page.ts +268 -123
- package/src/fingerprint.ts +127 -29
- package/src/gi.ts +26 -0
- package/src/gir/ancestry.ts +26 -14
- package/src/gir/callback.ts +10 -15
- package/src/gir/class.ts +20 -16
- package/src/gir/enum.ts +9 -7
- package/src/gir/field.ts +37 -8
- package/src/gir/function.ts +33 -9
- package/src/gir/gir-path.ts +36 -12
- package/src/gir/libraries.ts +56 -31
- package/src/gir/library.ts +200 -97
- package/src/gir/namespace.ts +42 -26
- package/src/gir/nullable-overrides.ts +5 -0
- package/src/gir/parameter.ts +80 -42
- package/src/gir/parse.ts +102 -47
- package/src/gir/primitives.ts +25 -23
- package/src/gir/property.ts +13 -11
- package/src/gir/record.ts +16 -14
- package/src/gir/size.ts +91 -58
- package/src/gir/type-id.ts +33 -18
- package/src/gir/type-ref.ts +62 -26
- package/src/gir/type.ts +10 -8
- package/src/index.ts +7 -0
- package/src/jsx.ts +70 -0
- package/src/khronos/args.ts +158 -89
- package/src/khronos/jsdoc.ts +67 -29
- package/src/khronos/model.ts +154 -53
- package/src/khronos/modules.ts +67 -27
- package/src/khronos/param-pair.ts +14 -0
- package/src/khronos/parse.ts +37 -17
- package/src/khronos/pipeline.ts +193 -90
- package/src/khronos/plan.ts +235 -86
- package/src/khronos/render.ts +208 -71
- package/src/khronos/select.ts +48 -18
- package/src/react/element-config.ts +91 -0
- package/src/runner.ts +93 -57
- package/src/store/compile-store.ts +32 -26
- package/src/store/gi/async.ts +48 -21
- package/src/store/gi/callables.ts +345 -136
- package/src/store/gi/callback.ts +13 -4
- package/src/store/gi/class-struct-record.ts +49 -17
- package/src/store/gi/class.ts +186 -64
- package/src/store/gi/companion.ts +15 -6
- package/src/store/gi/constant.ts +42 -8
- package/src/store/gi/constructor-props.ts +42 -16
- package/src/store/gi/enum.ts +28 -13
- package/src/store/gi/function.ts +90 -24
- package/src/store/gi/gtype-binding.ts +31 -18
- package/src/store/gi/interface.ts +101 -36
- package/src/store/gi/item-comparators.ts +74 -26
- package/src/store/gi/method.ts +376 -159
- package/src/store/gi/param-marshal.ts +38 -15
- package/src/store/gi/pipeline.ts +72 -22
- package/src/store/gi/properties.ts +16 -5
- package/src/store/gi/property-accessor.ts +192 -84
- package/src/store/gi/record-constructor.ts +62 -30
- package/src/store/gi/record-field-accessor.ts +380 -167
- package/src/store/gi/record-layout.ts +130 -43
- package/src/store/gi/record.ts +37 -14
- package/src/store/gi/registration.ts +15 -9
- package/src/store/gi/return-wrap.ts +71 -23
- package/src/store/gi/runtime-override.ts +13 -3
- package/src/store/gi/signal.ts +244 -104
- package/src/store/gi/vtable.ts +117 -41
- package/src/store/gi-store.ts +26 -13
- package/src/store/jsx/element-components.ts +152 -0
- package/src/store/jsx/element-prop-imports.ts +24 -0
- package/src/store/jsx/element-prop-types.ts +59 -0
- package/src/store/jsx/gir-index.ts +62 -0
- package/src/store/jsx/intrinsic-elements.ts +262 -0
- package/src/store/{react → jsx}/jsx.ts +213 -99
- package/src/store/jsx/metadata.ts +385 -0
- package/src/store/jsx/pipeline.ts +145 -0
- package/src/store/jsx/props.ts +274 -0
- package/src/store/jsx-store.ts +15 -3
- package/src/store/store-fs.ts +36 -20
- package/src/writer/context.ts +25 -6
- package/src/writer/doc.ts +19 -5
- package/src/writer/emit.ts +20 -11
- package/src/writer/gtk-doc.ts +48 -21
- package/src/writer/imports.ts +63 -28
- package/src/writer/module.ts +35 -11
- package/src/xml.ts +12 -0
- package/dist/store/react/built-ins.d.ts +0 -9
- package/dist/store/react/built-ins.d.ts.map +0 -1
- package/dist/store/react/built-ins.js +0 -226
- package/dist/store/react/built-ins.js.map +0 -1
- package/dist/store/react/element-components.d.ts +0 -15
- package/dist/store/react/element-components.d.ts.map +0 -1
- package/dist/store/react/element-components.js +0 -92
- package/dist/store/react/element-components.js.map +0 -1
- package/dist/store/react/element-prop-types.d.ts +0 -19
- package/dist/store/react/element-prop-types.d.ts.map +0 -1
- package/dist/store/react/element-prop-types.js +0 -244
- package/dist/store/react/element-prop-types.js.map +0 -1
- package/dist/store/react/element-props.d.ts +0 -4
- package/dist/store/react/element-props.d.ts.map +0 -1
- package/dist/store/react/element-props.js +0 -178
- package/dist/store/react/element-props.js.map +0 -1
- package/dist/store/react/gir-index.d.ts +0 -25
- package/dist/store/react/gir-index.d.ts.map +0 -1
- package/dist/store/react/gir-index.js +0 -55
- package/dist/store/react/gir-index.js.map +0 -1
- package/dist/store/react/intrinsic-elements.d.ts +0 -26
- package/dist/store/react/intrinsic-elements.d.ts.map +0 -1
- package/dist/store/react/intrinsic-elements.js +0 -107
- package/dist/store/react/intrinsic-elements.js.map +0 -1
- package/dist/store/react/jsx.d.ts.map +0 -1
- package/dist/store/react/jsx.js.map +0 -1
- package/dist/store/react/metadata.d.ts +0 -4
- package/dist/store/react/metadata.d.ts.map +0 -1
- package/dist/store/react/metadata.js.map +0 -1
- package/dist/store/react/pipeline.d.ts +0 -14
- package/dist/store/react/pipeline.d.ts.map +0 -1
- package/dist/store/react/pipeline.js.map +0 -1
- package/dist/store/react/props.d.ts.map +0 -1
- package/dist/store/react/props.js +0 -133
- package/dist/store/react/props.js.map +0 -1
- package/overrides/gtk/constants.ts.ejs +0 -3
- package/overrides/gtk/index.ts.ejs +0 -2
- package/src/store/react/built-ins.ts +0 -260
- package/src/store/react/element-components.ts +0 -138
- package/src/store/react/element-prop-types.ts +0 -280
- package/src/store/react/element-props.ts +0 -204
- package/src/store/react/gir-index.ts +0 -85
- package/src/store/react/intrinsic-elements.ts +0 -161
- package/src/store/react/metadata.ts +0 -197
- package/src/store/react/pipeline.ts +0 -90
- package/src/store/react/props.ts +0 -197
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vtable.js","sourceRoot":"","sources":["../../../src/store/gi/vtable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"vtable.js","sourceRoot":"","sources":["../../../src/store/gi/vtable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAA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,KAAK,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;AACxD,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { pascalCase, sourceStringLiteral, toCamelIdentifier } from \"@gtkx/utils\";\nimport type { GirCallback } from \"../../gir/callback.js\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport type { GirField } from \"../../gir/field.js\";\nimport type { GirParameter } from \"../../gir/parameter.js\";\nimport type { ModuleContext } from \"../../writer/context.js\";\nimport {\n isInlineCallbackRef,\n isScalarRef,\n renderDescriptor,\n renderParamDescriptor,\n} from \"../../analysis/descriptor-render.js\";\nimport { renderBraced } from \"../../writer/emit.js\";\nimport { computeRecordFieldSlots } from \"./record-layout.js\";\n\ntype VtableKind = \"class\" | \"interface\";\n\ntype RenderVtableSlotDescriptorOptions = {\n key: string;\n structName: string;\n kind: VtableKind;\n field: GirField;\n callback: GirCallback;\n byteOffset: number;\n vtableSize: number;\n};\n\nconst renderVfuncMetadata = (context: ModuleContext, klass: GirClass): string | undefined => {\n if (klass.glibTypeStruct === undefined) {\n return undefined;\n }\n\n const structName = pascalCase(klass.glibTypeStruct);\n const kind: VtableKind = klass.isInterface ? \"interface\" : \"class\";\n const entries = vtableEntries(context, structName, kind, klass.glibTypeStruct);\n\n if (entries.length === 0) {\n return undefined;\n }\n\n return renderBraced(entries.join(\"\\n\"));\n};\n\nconst vtableCallbackType = (context: ModuleContext, field: GirField): GirCallback | undefined => {\n if (field.type === undefined) {\n return undefined;\n }\n\n const type = context.library.typeFor(field.type);\n\n if (type?.kind !== \"callback\" || context.library.nameFor(field.type) !== undefined) {\n return undefined;\n }\n\n return type.value;\n};\n\nconst vtableSlotEntry = (\n context: ModuleContext,\n field: GirField,\n claimedNames: Set<string>,\n): { key: string; callback: GirCallback } | undefined => {\n const callback = vtableCallbackType(context, field);\n\n if (callback === undefined) {\n return undefined;\n }\n\n const key = toCamelIdentifier(field.name);\n\n if (key === \"constructor\" || claimedNames.has(key)) {\n return undefined;\n }\n\n if (!isVtableSlotEligible(context, callback)) {\n return undefined;\n }\n\n return { key, callback };\n};\n\nconst vtableEntries = (context: ModuleContext, structName: string, kind: VtableKind, typeStruct: string): string[] => {\n const resolved = context.library.resolveType(context.namespace.name, typeStruct);\n\n if (resolved?.kind !== \"record\") {\n return [];\n }\n\n const { slots, size } = computeRecordFieldSlots(context, resolved.value.fields, resolved.value.isUnion);\n const entries: string[] = [];\n const claimedNames: Set<string> = new Set();\n\n for (const { field, slot } of slots) {\n const entry = vtableSlotEntry(context, field, claimedNames);\n\n if (entry === undefined) {\n continue;\n }\n\n claimedNames.add(entry.key);\n\n entries.push(\n renderVtableSlotDescriptor(context, {\n key: entry.key,\n structName,\n kind,\n field,\n callback: entry.callback,\n byteOffset: slot.byteOffset,\n vtableSize: size,\n }),\n );\n }\n\n return entries;\n};\n\nconst isUnsupportedOutParam = (context: ModuleContext, param: GirParameter): boolean =>\n (param.direction === \"out\" || param.direction === \"inout\") &&\n !param.callerAllocates &&\n !isScalarRef(context.library, param.type);\n\nconst isEligibleVtableParam = (context: ModuleContext, param: GirParameter): boolean => {\n if (param.isVarargs) {\n return false;\n }\n\n if (isUnsupportedOutParam(context, param)) {\n return false;\n }\n\n return !isInlineCallbackRef(context.library, param.type);\n};\n\nconst isVtableSlotEligible = (context: ModuleContext, callback: GirCallback): boolean => {\n if (!callback.introspectable) {\n return false;\n }\n\n for (const param of callback.parameters) {\n if (!isEligibleVtableParam(context, param)) {\n return false;\n }\n }\n\n return !isInlineCallbackRef(context.library, callback.returnValue.type);\n};\n\nconst renderVtableSlotDescriptor = (context: ModuleContext, options: RenderVtableSlotDescriptorOptions): string => {\n const { key, structName, kind, field, callback, byteOffset, vtableSize } = options;\n\n const argDescriptors = callback.parameters\n .map((param) => renderParamDescriptor(context, param, param.type))\n .join(\", \");\n\n const returnDescriptor = renderDescriptor(\n context,\n callback.returnValue.type,\n callback.returnValue.transferOwnership,\n );\n\n const lines = [\n `kind: ${sourceStringLiteral(kind)} as const,`,\n `className: ${sourceStringLiteral(structName)},`,\n `vfuncName: ${sourceStringLiteral(field.name)},`,\n `byteOffset: ${String(byteOffset)},`,\n `vtableSize: ${String(vtableSize)},`,\n `argDescriptors: [${argDescriptors}],`,\n `returnDescriptor: ${returnDescriptor},`,\n ];\n\n return `${key}: ${renderBraced(lines.join(\"\\n\"))},`;\n};\n\nexport { renderVfuncMetadata };\n"]}
|
package/dist/store/gi-store.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GiFingerprint } from "../fingerprint.js";
|
|
2
2
|
import { type StoreOptions } from "./store-fs.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type GiStoreOptions = StoreOptions;
|
|
4
|
+
type GiNamespaceInput = {
|
|
5
5
|
directory: string;
|
|
6
6
|
rawSource: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
declare const writeGiStore: (options: GiStoreOptions, namespaces: GiNamespaceInput[], fingerprint: GiFingerprint) => void;
|
|
9
|
+
export { writeGiStore, type GiStoreOptions, type GiNamespaceInput };
|
|
9
10
|
//# sourceMappingURL=gi-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gi-store.d.ts","sourceRoot":"","sources":["../../src/store/gi-store.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"gi-store.d.ts","sourceRoot":"","sources":["../../src/store/gi-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAiB,KAAK,YAAY,EAA6B,MAAM,eAAe,CAAC;AAE5F,KAAK,cAAc,GAAG,YAAY,CAAC;AAEnC,KAAK,gBAAgB,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AA2DF,QAAA,MAAM,YAAY,GACd,SAAS,cAAc,EACvB,YAAY,gBAAgB,EAAE,EAC9B,aAAa,aAAa,KAC3B,IAeF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
package/dist/store/gi-store.js
CHANGED
|
@@ -6,8 +6,9 @@ import { buildManifest, subpathExport, writeStore } from "./store-fs.js";
|
|
|
6
6
|
const OVERRIDES_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "overrides");
|
|
7
7
|
const overrideFiles = (directory) => {
|
|
8
8
|
const dir = join(OVERRIDES_ROOT, directory);
|
|
9
|
-
if (!existsSync(dir))
|
|
9
|
+
if (!existsSync(dir)) {
|
|
10
10
|
return [];
|
|
11
|
+
}
|
|
11
12
|
return readdirSync(dir).filter((name) => name.endsWith(".ejs") && name !== "index.ts.ejs");
|
|
12
13
|
};
|
|
13
14
|
const barrelSource = (directory) => {
|
|
@@ -39,7 +40,7 @@ const collectStoreSources = (namespaces) => {
|
|
|
39
40
|
}
|
|
40
41
|
return { collected, exportsMap };
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
const writeGiStore = (options, namespaces, fingerprint) => {
|
|
43
44
|
const { collected, exportsMap } = collectStoreSources(namespaces);
|
|
44
45
|
writeStore({
|
|
45
46
|
storeDir: options.storeDir,
|
|
@@ -54,4 +55,5 @@ export const writeGiStore = (options, namespaces, fingerprint) => {
|
|
|
54
55
|
rawFiles: [{ relativePath: FINGERPRINT_FILENAME, content: `${JSON.stringify(fingerprint, null, 2)}\n` }],
|
|
55
56
|
});
|
|
56
57
|
};
|
|
58
|
+
export { writeGiStore };
|
|
57
59
|
//# sourceMappingURL=gi-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gi-store.js","sourceRoot":"","sources":["../../src/store/gi-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,S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AAC,CAAC;IAElE,UAAU,CAAC;QACP,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,aAAa,CAAC;YACpB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,UAAU;YACnB,gBAAgB,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE;SAC7C,CAAC;QACF,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KAC3G,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAA8C,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { FINGERPRINT_FILENAME, type GiFingerprint } from \"../fingerprint.js\";\nimport { buildManifest, type StoreOptions, subpathExport, writeStore } from \"./store-fs.js\";\n\ntype GiStoreOptions = StoreOptions;\n\ntype GiNamespaceInput = {\n directory: string;\n rawSource: string;\n};\n\ntype CollectedFile = {\n fileName: string;\n source: string;\n};\n\nconst OVERRIDES_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), \"..\", \"..\", \"overrides\");\n\nconst overrideFiles = (directory: string): string[] => {\n const dir = join(OVERRIDES_ROOT, directory);\n\n if (!existsSync(dir)) {\n return [];\n }\n\n return readdirSync(dir).filter((name) => name.endsWith(\".ejs\") && name !== \"index.ts.ejs\");\n};\n\nconst barrelSource = (directory: string): string => {\n const overrideIndex = join(OVERRIDES_ROOT, directory, \"index.ts.ejs\");\n\n if (!existsSync(overrideIndex)) {\n return `export * from \"./${directory}.js\";\\n`;\n }\n\n return readFileSync(overrideIndex, \"utf8\");\n};\n\nconst collectStoreSources = (\n namespaces: GiNamespaceInput[],\n): { collected: CollectedFile[]; exportsMap: Record<string, unknown> } => {\n const exportsMap: Record<string, unknown> = {};\n const collected: CollectedFile[] = [];\n\n for (const { directory, rawSource } of namespaces) {\n collected.push({\n fileName: `${directory}/${directory}.ts`,\n source: rawSource,\n });\n\n for (const file of overrideFiles(directory)) {\n collected.push({\n fileName: `${directory}/overrides/${file.replace(/\\.ejs$/, \"\")}`,\n source: readFileSync(join(OVERRIDES_ROOT, directory, file), \"utf8\"),\n });\n }\n\n collected.push({\n fileName: `${directory}/index.ts`,\n source: barrelSource(directory),\n });\n\n exportsMap[`./${directory}`] = subpathExport(`${directory}/index`);\n }\n\n return { collected, exportsMap };\n};\n\nconst writeGiStore = (\n options: GiStoreOptions,\n namespaces: GiNamespaceInput[],\n fingerprint: GiFingerprint,\n): void => {\n const { collected, exportsMap } = collectStoreSources(namespaces);\n\n writeStore({\n storeDir: options.storeDir,\n linkDir: options.linkDir,\n files: collected,\n manifest: buildManifest({\n name: \"@gtkx/gi\",\n version: options.version,\n exports: exportsMap,\n peerDependencies: { \"@gtkx/runtime\": \"*\" },\n }),\n rawFiles: [{ relativePath: FINGERPRINT_FILENAME, content: `${JSON.stringify(fingerprint, null, 2)}\\n` }],\n });\n};\n\nexport { writeGiStore, type GiStoreOptions, type GiNamespaceInput };\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Library } from "../../gir/library.js";
|
|
2
|
+
import type { GirNamespace } from "../../gir/namespace.js";
|
|
3
|
+
import type { ImportsBuilder } from "../../writer/imports.js";
|
|
4
|
+
import type { LazyElementSpec } from "./element-prop-types.js";
|
|
5
|
+
import { type GlibNamedClass } from "./intrinsic-elements.js";
|
|
6
|
+
/** A component that wraps a generated element, keyed by GLib type name (built-in or user-provided). */
|
|
7
|
+
type ElementComponent = {
|
|
8
|
+
module: string;
|
|
9
|
+
export: string;
|
|
10
|
+
};
|
|
11
|
+
/** Component wrappers keyed by GLib type name; the framework's built-ins merged with the project's own. */
|
|
12
|
+
type ElementComponentOverrides = Record<string, ElementComponent>;
|
|
13
|
+
declare const generateElementComponentsSection: (targetNamespace: GirNamespace, library: Library, options: {
|
|
14
|
+
imports: ImportsBuilder;
|
|
15
|
+
lazyElements: LazyElementSpec[];
|
|
16
|
+
intrinsicElements: GlibNamedClass[];
|
|
17
|
+
components: ElementComponentOverrides;
|
|
18
|
+
}) => {
|
|
19
|
+
source: string;
|
|
20
|
+
exportedNames: Set<string>;
|
|
21
|
+
};
|
|
22
|
+
export { generateElementComponentsSection, type ElementComponent, type ElementComponentOverrides };
|
|
23
|
+
//# sourceMappingURL=element-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-components.d.ts","sourceRoot":"","sources":["../../../src/store/jsx/element-components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEjF,uGAAuG;AACvG,KAAK,gBAAgB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3D,2GAA2G;AAC3G,KAAK,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAgBlE,QAAA,MAAM,gCAAgC,GAClC,iBAAiB,YAAY,EAC7B,SAAS,OAAO,EAChB,SAAS;IACL,OAAO,EAAE,cAAc,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,iBAAiB,EAAE,cAAc,EAAE,CAAC;IACpC,UAAU,EAAE,yBAAyB,CAAC;CACzC,KACF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAiB9C,CAAC;AAkGF,OAAO,EAAE,gCAAgC,EAAE,KAAK,gBAAgB,EAAE,KAAK,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { sourceStringLiteral } from "@gtkx/utils";
|
|
2
|
+
import { renderJsDoc } from "../../writer/doc.js";
|
|
3
|
+
import { ancestorGlibNames } from "./intrinsic-elements.js";
|
|
4
|
+
const generateElementComponentsSection = (targetNamespace, library, options) => {
|
|
5
|
+
const collector = { imports: options.imports, exportedNames: new Set(), exportLines: [] };
|
|
6
|
+
const lazyElements = options.lazyElements;
|
|
7
|
+
const virtualNames = new Set(lazyElements.map((entry) => entry.element));
|
|
8
|
+
collectCandidateExports(collector, {
|
|
9
|
+
targetNamespace,
|
|
10
|
+
library,
|
|
11
|
+
virtualNames,
|
|
12
|
+
intrinsicElements: options.intrinsicElements,
|
|
13
|
+
components: options.components,
|
|
14
|
+
});
|
|
15
|
+
collectLazyElementExports(collector, lazyElements);
|
|
16
|
+
const source = collector.exportLines.join("\n\n");
|
|
17
|
+
return { source, exportedNames: collector.exportedNames };
|
|
18
|
+
};
|
|
19
|
+
const appendCandidateExport = (collector, candidate, options) => {
|
|
20
|
+
const { targetNamespace, library, virtualNames, components } = options;
|
|
21
|
+
if (candidate.namespace.name !== targetNamespace.name) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (virtualNames.has(candidate.glibName)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const line = renderCandidateExport(candidate, library, collector.imports, components);
|
|
28
|
+
collector.exportLines.push(line);
|
|
29
|
+
collector.exportedNames.add(candidate.glibName);
|
|
30
|
+
};
|
|
31
|
+
// An abstract GType cannot be instantiated: `g_object_new` on one is a fatal GObject error rather
|
|
32
|
+
// than a NULL return. Its props interface and metadata still have to be emitted, since every
|
|
33
|
+
// concrete subclass extends them, so only the constructible component export is withheld.
|
|
34
|
+
const collectCandidateExports = (collector, options) => {
|
|
35
|
+
for (const candidate of options.intrinsicElements) {
|
|
36
|
+
if (candidate.klass.isAbstract) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
appendCandidateExport(collector, candidate, options);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const collectLazyElementExports = (collector, lazyElements) => {
|
|
43
|
+
for (const spec of lazyElements) {
|
|
44
|
+
collector.imports.addNamed("@gtkx/react/internal", "createElementComponent", false);
|
|
45
|
+
collector.imports.addNamed("react", "ReactNode", true);
|
|
46
|
+
collector.exportLines.push(renderLazyElementExport(spec));
|
|
47
|
+
collector.exportedNames.add(spec.element);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const renderLazyElementExport = (spec) => {
|
|
51
|
+
const factory = `createElementComponent(${sourceStringLiteral(spec.element)})`;
|
|
52
|
+
const component = `export const ${spec.element}: (props: ${spec.typeName}) => ReactNode = ${factory};`;
|
|
53
|
+
return `${spec.typeSource}\n\n${component}`;
|
|
54
|
+
};
|
|
55
|
+
const renderCandidateExport = (candidate, library, imports, components) => {
|
|
56
|
+
const { glibName, klass, namespace } = candidate;
|
|
57
|
+
const ancestry = ancestorGlibNames(klass, namespace, library);
|
|
58
|
+
const component = resolveElementComponent(ancestry, components);
|
|
59
|
+
imports.addNamed("@gtkx/react/internal", "createElementComponent", false);
|
|
60
|
+
imports.addNamed("react", "ReactNode", true);
|
|
61
|
+
if (component !== undefined) {
|
|
62
|
+
imports.addNamed(component.module, component.export, false);
|
|
63
|
+
}
|
|
64
|
+
return `${renderJsDoc(klass.doc)}${renderElementComponentExport(glibName, component)}`;
|
|
65
|
+
};
|
|
66
|
+
/** The component for the nearest ancestry match, most-derived first; user overrides win on their exact type. */
|
|
67
|
+
const resolveElementComponent = (ancestry, components) => {
|
|
68
|
+
for (const name of ancestry) {
|
|
69
|
+
const found = components[name];
|
|
70
|
+
if (found !== undefined) {
|
|
71
|
+
return found;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
};
|
|
76
|
+
const renderElementComponentExport = (glibName, component) => {
|
|
77
|
+
const propsType = `${glibName}Props`;
|
|
78
|
+
const annotation = `(props: ${propsType}) => ReactNode`;
|
|
79
|
+
const factoryCall = `createElementComponent(${sourceStringLiteral(glibName)})`;
|
|
80
|
+
if (component === undefined) {
|
|
81
|
+
return `export const ${glibName}: ${annotation} = ${factoryCall};`;
|
|
82
|
+
}
|
|
83
|
+
return `export const ${glibName}: ${annotation} = ${component.export}(${factoryCall});`;
|
|
84
|
+
};
|
|
85
|
+
export { generateElementComponentsSection };
|
|
86
|
+
//# sourceMappingURL=element-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-components.js","sourceRoot":"","sources":["../../../src/store/jsx/element-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAuB,MAAM,yBAAyB,CAAC;AAqBjF,MAAM,gCAAgC,GAAG,CACrC,eAA6B,EAC7B,OAAgB,EAChB,OAKC,EAC6C,EAAE;IAChD,MAAM,SAAS,GAAoB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAC3G,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC1C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzE,uBAAuB,CAAC,SAAS,EAAE;QAC/B,eAAe;QACf,OAAO;QACP,YAAY;QACZ,iBAAiB,EAAE,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type { GirNamespace } from \"../../gir/namespace.js\";\nimport type { ImportsBuilder } from \"../../writer/imports.js\";\nimport type { LazyElementSpec } from \"./element-prop-types.js\";\nimport { renderJsDoc } from \"../../writer/doc.js\";\nimport { ancestorGlibNames, type GlibNamedClass } from \"./intrinsic-elements.js\";\n\n/** A component that wraps a generated element, keyed by GLib type name (built-in or user-provided). */\ntype ElementComponent = { module: string; export: string };\n/** Component wrappers keyed by GLib type name; the framework's built-ins merged with the project's own. */\ntype ElementComponentOverrides = Record<string, ElementComponent>;\n\ntype ExportCollector = {\n imports: ImportsBuilder;\n exportedNames: Set<string>;\n exportLines: string[];\n};\n\ntype CandidateExportOptions = {\n targetNamespace: GirNamespace;\n library: Library;\n virtualNames: Set<string>;\n intrinsicElements: GlibNamedClass[];\n components: Record<string, ElementComponent>;\n};\n\nconst generateElementComponentsSection = (\n targetNamespace: GirNamespace,\n library: Library,\n options: {\n imports: ImportsBuilder;\n lazyElements: LazyElementSpec[];\n intrinsicElements: GlibNamedClass[];\n components: ElementComponentOverrides;\n },\n): { source: string; exportedNames: Set<string> } => {\n const collector: ExportCollector = { imports: options.imports, exportedNames: new Set(), exportLines: [] };\n const lazyElements = options.lazyElements;\n const virtualNames = new Set(lazyElements.map((entry) => entry.element));\n\n collectCandidateExports(collector, {\n targetNamespace,\n library,\n virtualNames,\n intrinsicElements: options.intrinsicElements,\n components: options.components,\n });\n\n collectLazyElementExports(collector, lazyElements);\n const source = collector.exportLines.join(\"\\n\\n\");\n\n return { source, exportedNames: collector.exportedNames };\n};\n\nconst appendCandidateExport = (\n collector: ExportCollector,\n candidate: GlibNamedClass,\n options: CandidateExportOptions,\n): void => {\n const { targetNamespace, library, virtualNames, components } = options;\n\n if (candidate.namespace.name !== targetNamespace.name) {\n return;\n }\n\n if (virtualNames.has(candidate.glibName)) {\n return;\n }\n\n const line = renderCandidateExport(candidate, library, collector.imports, components);\n collector.exportLines.push(line);\n collector.exportedNames.add(candidate.glibName);\n};\n\n// An abstract GType cannot be instantiated: `g_object_new` on one is a fatal GObject error rather\n// than a NULL return. Its props interface and metadata still have to be emitted, since every\n// concrete subclass extends them, so only the constructible component export is withheld.\nconst collectCandidateExports = (collector: ExportCollector, options: CandidateExportOptions): void => {\n for (const candidate of options.intrinsicElements) {\n if (candidate.klass.isAbstract) {\n continue;\n }\n\n appendCandidateExport(collector, candidate, options);\n }\n};\n\nconst collectLazyElementExports = (collector: ExportCollector, lazyElements: LazyElementSpec[]): void => {\n for (const spec of lazyElements) {\n collector.imports.addNamed(\"@gtkx/react/internal\", \"createElementComponent\", false);\n collector.imports.addNamed(\"react\", \"ReactNode\", true);\n collector.exportLines.push(renderLazyElementExport(spec));\n collector.exportedNames.add(spec.element);\n }\n};\n\nconst renderLazyElementExport = (spec: LazyElementSpec): string => {\n const factory = `createElementComponent(${sourceStringLiteral(spec.element)})`;\n const component = `export const ${spec.element}: (props: ${spec.typeName}) => ReactNode = ${factory};`;\n\n return `${spec.typeSource}\\n\\n${component}`;\n};\n\nconst renderCandidateExport = (\n candidate: GlibNamedClass,\n library: Library,\n imports: ImportsBuilder,\n components: Record<string, ElementComponent>,\n): string => {\n const { glibName, klass, namespace } = candidate;\n const ancestry = ancestorGlibNames(klass, namespace, library);\n const component = resolveElementComponent(ancestry, components);\n imports.addNamed(\"@gtkx/react/internal\", \"createElementComponent\", false);\n imports.addNamed(\"react\", \"ReactNode\", true);\n\n if (component !== undefined) {\n imports.addNamed(component.module, component.export, false);\n }\n\n return `${renderJsDoc(klass.doc)}${renderElementComponentExport(glibName, component)}`;\n};\n\n/** The component for the nearest ancestry match, most-derived first; user overrides win on their exact type. */\nconst resolveElementComponent = (\n ancestry: string[],\n components: Record<string, ElementComponent>,\n): ElementComponent | undefined => {\n for (const name of ancestry) {\n const found = components[name];\n\n if (found !== undefined) {\n return found;\n }\n }\n\n return undefined;\n};\n\nconst renderElementComponentExport = (glibName: string, component: ElementComponent | undefined): string => {\n const propsType = `${glibName}Props`;\n const annotation = `(props: ${propsType}) => ReactNode`;\n const factoryCall = `createElementComponent(${sourceStringLiteral(glibName)})`;\n\n if (component === undefined) {\n return `export const ${glibName}: ${annotation} = ${factoryCall};`;\n }\n\n return `export const ${glibName}: ${annotation} = ${component.export}(${factoryCall});`;\n};\n\nexport { generateElementComponentsSection, type ElementComponent, type ElementComponentOverrides };\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Props interface a generated element's props extend, declared by hand in `@gtkx/react`. */
|
|
2
|
+
type ElementPropTypeRef = {
|
|
3
|
+
type: string;
|
|
4
|
+
module: string;
|
|
5
|
+
export: string;
|
|
6
|
+
};
|
|
7
|
+
/** Base props interface each element extends, keyed by GLib type name (the module exports it). */
|
|
8
|
+
type ElementProps = Record<string, {
|
|
9
|
+
module: string;
|
|
10
|
+
export: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** Installs the base props each element extends (GLib type name → `{ module, export }`); set once per run. */
|
|
13
|
+
declare const setElementProps: (props: ElementProps) => void;
|
|
14
|
+
/** The base props interface an element extends, when its element config declares one. */
|
|
15
|
+
declare const elementPropTypeFor: (glibName: string) => ElementPropTypeRef | undefined;
|
|
16
|
+
export { setElementProps, elementPropTypeFor, type ElementPropTypeRef, type ElementProps };
|
|
17
|
+
//# sourceMappingURL=element-prop-imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-prop-imports.d.ts","sourceRoot":"","sources":["../../../src/store/jsx/element-prop-imports.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,KAAK,kBAAkB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3E,kGAAkG;AAClG,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAIvE,8GAA8G;AAC9G,QAAA,MAAM,eAAe,GAAI,OAAO,YAAY,KAAG,IAM9C,CAAC;AAEF,yFAAyF;AACzF,QAAA,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,kBAAkB,GAAG,SAInE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const elementProps = new Map();
|
|
2
|
+
/** Installs the base props each element extends (GLib type name → `{ module, export }`); set once per run. */
|
|
3
|
+
const setElementProps = (props) => {
|
|
4
|
+
elementProps.clear();
|
|
5
|
+
for (const [glibName, ref] of Object.entries(props)) {
|
|
6
|
+
elementProps.set(glibName, ref);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
/** The base props interface an element extends, when its element config declares one. */
|
|
10
|
+
const elementPropTypeFor = (glibName) => {
|
|
11
|
+
const ref = elementProps.get(glibName);
|
|
12
|
+
return ref === undefined ? undefined : { type: glibName, module: ref.module, export: ref.export };
|
|
13
|
+
};
|
|
14
|
+
export { setElementProps, elementPropTypeFor };
|
|
15
|
+
//# sourceMappingURL=element-prop-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-prop-imports.js","sourceRoot":"","sources":["../../../src/store/jsx/element-prop-imports.ts"],"names":[],"mappings":"AAKA,MAAM,YAAY,GAAoD,IAAI,GAAG,EAAE,CAAC;AAEhF,8GAA8G;AAC9G,MAAM,eAAe,GAAG,CAAC,KAAmB,EAAQ,EAAE;IAClD,YAAY,CAAC,KAAK,EAAE,CAAC;IAErB,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;AACL,CAAC,CAAC;AAEF,yFAAyF;AACzF,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAkC,EAAE;IAC5E,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;AACtG,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAA8C,CAAC","sourcesContent":["/** Props interface a generated element's props extend, declared by hand in `@gtkx/react`. */\ntype ElementPropTypeRef = { type: string; module: string; export: string };\n/** Base props interface each element extends, keyed by GLib type name (the module exports it). */\ntype ElementProps = Record<string, { module: string; export: string }>;\n\nconst elementProps: Map<string, { module: string; export: string }> = new Map();\n\n/** Installs the base props each element extends (GLib type name → `{ module, export }`); set once per run. */\nconst setElementProps = (props: ElementProps): void => {\n elementProps.clear();\n\n for (const [glibName, ref] of Object.entries(props)) {\n elementProps.set(glibName, ref);\n }\n};\n\n/** The base props interface an element extends, when its element config declares one. */\nconst elementPropTypeFor = (glibName: string): ElementPropTypeRef | undefined => {\n const ref = elementProps.get(glibName);\n\n return ref === undefined ? undefined : { type: glibName, module: ref.module, export: ref.export };\n};\n\nexport { setElementProps, elementPropTypeFor, type ElementPropTypeRef, type ElementProps };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type GirIndex } from "./gir-index.js";
|
|
2
|
+
type LazyElementSpec = {
|
|
3
|
+
element: string;
|
|
4
|
+
typeName: string;
|
|
5
|
+
typeSource: string;
|
|
6
|
+
};
|
|
7
|
+
/** Lazy element prop types to emit, grouped by the namespace declaring each element. */
|
|
8
|
+
declare const lazyElementSpecs: (context: GirIndex, lazyElements: string[]) => Map<string, LazyElementSpec[]>;
|
|
9
|
+
export { lazyElementSpecs, type LazyElementSpec };
|
|
10
|
+
//# sourceMappingURL=element-prop-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-prop-types.d.ts","sourceRoot":"","sources":["../../../src/store/jsx/element-prop-types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAG5E,KAAK,eAAe,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AA8BF,wFAAwF;AACxF,QAAA,MAAM,gBAAgB,GAAI,SAAS,QAAQ,EAAE,cAAc,MAAM,EAAE,KAAG,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,CAgBlG,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { toCamelIdentifier } from "@gtkx/utils";
|
|
2
|
+
import { getChain } from "./gir-index.js";
|
|
3
|
+
import { getGlibName } from "./intrinsic-elements.js";
|
|
4
|
+
const appendConstructOnlyNames = (klass, names) => {
|
|
5
|
+
for (const property of klass.properties) {
|
|
6
|
+
if (property.constructOnly) {
|
|
7
|
+
names.push(toCamelIdentifier(property.name));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const constructOnlyNames = (context, entry) => {
|
|
12
|
+
const names = [];
|
|
13
|
+
for (const klass of getChain(context, entry)) {
|
|
14
|
+
appendConstructOnlyNames(klass, names);
|
|
15
|
+
}
|
|
16
|
+
return names;
|
|
17
|
+
};
|
|
18
|
+
const createLazyElementSpec = (context, element, entry) => {
|
|
19
|
+
const typeName = `${element}ElementProps`;
|
|
20
|
+
const baseName = getGlibName(entry.klass) ?? element;
|
|
21
|
+
const omitted = constructOnlyNames(context, entry);
|
|
22
|
+
const omitUnion = omitted.map((name) => JSON.stringify(name)).join(" | ");
|
|
23
|
+
const base = omitted.length === 0 ? `${baseName}Props` : `Omit<${baseName}Props, ${omitUnion}>`;
|
|
24
|
+
return { element, typeName, typeSource: `export type ${typeName} = ${base} & { children?: ReactNode };` };
|
|
25
|
+
};
|
|
26
|
+
/** Lazy element prop types to emit, grouped by the namespace declaring each element. */
|
|
27
|
+
const lazyElementSpecs = (context, lazyElements) => {
|
|
28
|
+
const specs = new Map();
|
|
29
|
+
for (const element of lazyElements) {
|
|
30
|
+
const entry = context.index.get(element);
|
|
31
|
+
if (entry === undefined) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const list = specs.get(entry.namespace.name) ?? [];
|
|
35
|
+
list.push(createLazyElementSpec(context, element, entry));
|
|
36
|
+
specs.set(entry.namespace.name, list);
|
|
37
|
+
}
|
|
38
|
+
return specs;
|
|
39
|
+
};
|
|
40
|
+
export { lazyElementSpecs };
|
|
41
|
+
//# sourceMappingURL=element-prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-prop-types.js","sourceRoot":"","sources":["../../../src/store/jsx/element-prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAoC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQtD,MAAM,wBAAwB,GAAG,CAAC,KAAe,EAAE,KAAe,EAAQ,EAAE;IACxE,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACtC,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,OAAiB,EAAE,KAAmB,EAAY,EAAE;IAC5E,MAAM,KAAK,GAAa,EAAE,C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I,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1D,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAwB,CAAC","sourcesContent":["import { toCamelIdentifier } from \"@gtkx/utils\";\nimport type { GirClass } from \"../../gir/class.js\";\nimport { getChain, type GirIndex, type GirTypeEntry } from \"./gir-index.js\";\nimport { getGlibName } from \"./intrinsic-elements.js\";\n\ntype LazyElementSpec = {\n element: string;\n typeName: string;\n typeSource: string;\n};\n\nconst appendConstructOnlyNames = (klass: GirClass, names: string[]): void => {\n for (const property of klass.properties) {\n if (property.constructOnly) {\n names.push(toCamelIdentifier(property.name));\n }\n }\n};\n\nconst constructOnlyNames = (context: GirIndex, entry: GirTypeEntry): string[] => {\n const names: string[] = [];\n\n for (const klass of getChain(context, entry)) {\n appendConstructOnlyNames(klass, names);\n }\n\n return names;\n};\n\nconst createLazyElementSpec = (context: GirIndex, element: string, entry: GirTypeEntry): LazyElementSpec => {\n const typeName = `${element}ElementProps`;\n const baseName = getGlibName(entry.klass) ?? element;\n const omitted = constructOnlyNames(context, entry);\n const omitUnion = omitted.map((name) => JSON.stringify(name)).join(\" | \");\n const base = omitted.length === 0 ? `${baseName}Props` : `Omit<${baseName}Props, ${omitUnion}>`;\n\n return { element, typeName, typeSource: `export type ${typeName} = ${base} & { children?: ReactNode };` };\n};\n\n/** Lazy element prop types to emit, grouped by the namespace declaring each element. */\nconst lazyElementSpecs = (context: GirIndex, lazyElements: string[]): Map<string, LazyElementSpec[]> => {\n const specs: Map<string, LazyElementSpec[]> = new Map();\n\n for (const element of lazyElements) {\n const entry = context.index.get(element);\n\n if (entry === undefined) {\n continue;\n }\n\n const list = specs.get(entry.namespace.name) ?? [];\n list.push(createLazyElementSpec(context, element, entry));\n specs.set(entry.namespace.name, list);\n }\n\n return specs;\n};\n\nexport { lazyElementSpecs, type LazyElementSpec };\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GirClass } from "../../gir/class.js";
|
|
2
|
+
import type { Library } from "../../gir/library.js";
|
|
3
|
+
import type { GirNamespace } from "../../gir/namespace.js";
|
|
4
|
+
type GirTypeEntry = {
|
|
5
|
+
klass: GirClass;
|
|
6
|
+
namespace: GirNamespace;
|
|
7
|
+
isInterface: boolean;
|
|
8
|
+
};
|
|
9
|
+
type GirIndex = {
|
|
10
|
+
library: Library;
|
|
11
|
+
index: Map<string, GirTypeEntry>;
|
|
12
|
+
};
|
|
13
|
+
declare const buildGirIndex: (library: Library) => GirIndex;
|
|
14
|
+
declare const getChain: (context: GirIndex, entry: GirTypeEntry) => GirClass[];
|
|
15
|
+
export { buildGirIndex, getChain, type GirTypeEntry, type GirIndex };
|
|
16
|
+
//# sourceMappingURL=gir-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gir-index.d.ts","sourceRoot":"","sources":["../../../src/store/jsx/gir-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACpC,CAAC;AAiBF,QAAA,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,QASzC,CAAC;AAEF,QAAA,MAAM,QAAQ,GAAI,SAAS,QAAQ,EAAE,OAAO,YAAY,KAAG,QAAQ,EAgBlE,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ancestorChain } from "../../gir/ancestry.js";
|
|
2
|
+
import { getGlibName, implementedInterfaces } from "./intrinsic-elements.js";
|
|
3
|
+
const indexClasses = (index, classes, namespace, isInterface) => {
|
|
4
|
+
for (const klass of classes) {
|
|
5
|
+
const glibName = getGlibName(klass);
|
|
6
|
+
if (glibName !== undefined && !index.has(glibName)) {
|
|
7
|
+
index.set(glibName, { klass, namespace, isInterface });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const buildGirIndex = (library) => {
|
|
12
|
+
const index = new Map();
|
|
13
|
+
for (const namespace of library.namespaces.values()) {
|
|
14
|
+
indexClasses(index, namespace.classes, namespace, false);
|
|
15
|
+
indexClasses(index, namespace.interfaces, namespace, true);
|
|
16
|
+
}
|
|
17
|
+
return { library, index };
|
|
18
|
+
};
|
|
19
|
+
const getChain = (context, entry) => {
|
|
20
|
+
if (entry.isInterface) {
|
|
21
|
+
return [entry.klass];
|
|
22
|
+
}
|
|
23
|
+
const chain = [];
|
|
24
|
+
for (const { klass } of ancestorChain(context.library, entry.klass, entry.namespace.name)) {
|
|
25
|
+
chain.push(klass);
|
|
26
|
+
}
|
|
27
|
+
for (const iface of implementedInterfaces(entry.klass, entry.namespace, context.library)) {
|
|
28
|
+
chain.push(iface.klass);
|
|
29
|
+
}
|
|
30
|
+
return chain;
|
|
31
|
+
};
|
|
32
|
+
export { buildGirIndex, getChain };
|
|
33
|
+
//# sourceMappingURL=gir-index.js.map
|
|
@@ -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C;IAED,MAAM,KAAK,GAAe,EAAE,CAAC;IAE7B,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAoC,CAAC","sourcesContent":["import type { GirClass } from \"../../gir/class.js\";\nimport type { Library } from \"../../gir/library.js\";\nimport type { GirNamespace } from \"../../gir/namespace.js\";\nimport { ancestorChain } from \"../../gir/ancestry.js\";\nimport { getGlibName, implementedInterfaces } from \"./intrinsic-elements.js\";\n\ntype GirTypeEntry = {\n klass: GirClass;\n namespace: GirNamespace;\n isInterface: boolean;\n};\n\ntype GirIndex = {\n library: Library;\n index: Map<string, GirTypeEntry>;\n};\n\nconst indexClasses = (\n index: Map<string, GirTypeEntry>,\n classes: Iterable<GirClass>,\n namespace: GirNamespace,\n isInterface: boolean,\n): void => {\n for (const klass of classes) {\n const glibName = getGlibName(klass);\n\n if (glibName !== undefined && !index.has(glibName)) {\n index.set(glibName, { klass, namespace, isInterface });\n }\n }\n};\n\nconst buildGirIndex = (library: Library): GirIndex => {\n const index: Map<string, GirTypeEntry> = new Map();\n\n for (const namespace of library.namespaces.values()) {\n indexClasses(index, namespace.classes, namespace, false);\n indexClasses(index, namespace.interfaces, namespace, true);\n }\n\n return { library, index };\n};\n\nconst getChain = (context: GirIndex, entry: GirTypeEntry): GirClass[] => {\n if (entry.isInterface) {\n return [entry.klass];\n }\n\n const chain: GirClass[] = [];\n\n for (const { klass } of ancestorChain(context.library, entry.klass, entry.namespace.name)) {\n chain.push(klass);\n }\n\n for (const iface of implementedInterfaces(entry.klass, entry.namespace, context.library)) {\n chain.push(iface.klass);\n }\n\n return chain;\n};\n\nexport { buildGirIndex, getChain, type GirTypeEntry, type GirIndex };\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GirClass } from "../../gir/class.js";
|
|
2
|
+
import type { Library } from "../../gir/library.js";
|
|
3
|
+
import type { GirNamespace } from "../../gir/namespace.js";
|
|
4
|
+
type GlibNamedClass = {
|
|
5
|
+
glibName: string;
|
|
6
|
+
klass: GirClass;
|
|
7
|
+
namespace: GirNamespace;
|
|
8
|
+
};
|
|
9
|
+
type ResolvedQualifiedInterface = {
|
|
10
|
+
klass: GirClass;
|
|
11
|
+
namespace: GirNamespace;
|
|
12
|
+
};
|
|
13
|
+
type HasContainerProps = (glibName: string | undefined) => boolean;
|
|
14
|
+
declare const signalHandlerName: (signalName: string) => string;
|
|
15
|
+
declare function iterateClassesWithGlibName(library: Library): IterableIterator<GlibNamedClass>;
|
|
16
|
+
declare const implementedInterfaces: (klass: GirClass, namespace: GirNamespace, library: Library) => ResolvedQualifiedInterface[];
|
|
17
|
+
declare const getGlibName: (klass: GirClass) => string | undefined;
|
|
18
|
+
declare const giNamespaceAlias: (namespaceName: string) => string;
|
|
19
|
+
declare const hasInterfacePropsBody: (klass: GirClass, hasContainerProps?: HasContainerProps) => boolean;
|
|
20
|
+
declare const newlyImplementedInterfaces: (klass: GirClass, namespace: GirNamespace, library: Library, hasContainerProps?: HasContainerProps) => ResolvedQualifiedInterface[];
|
|
21
|
+
declare const collectInterfacePropsClasses: (library: Library, intrinsicElements: GlibNamedClass[], targetNamespaceName: string, hasContainerProps?: HasContainerProps) => ResolvedQualifiedInterface[];
|
|
22
|
+
declare const ancestorGlibNames: (klass: GirClass, namespace: GirNamespace, library: Library) => string[];
|
|
23
|
+
declare const hasExposedMethod: (klass: GirClass, namespace: GirNamespace, library: Library, methodName: string) => boolean;
|
|
24
|
+
declare const isIntrinsicElementClass: (klass: GirClass, namespace: GirNamespace, library: Library) => boolean;
|
|
25
|
+
declare const collectIntrinsicElementClasses: (library: Library) => GlibNamedClass[];
|
|
26
|
+
export { signalHandlerName, iterateClassesWithGlibName, implementedInterfaces, getGlibName, giNamespaceAlias, hasInterfacePropsBody, newlyImplementedInterfaces, collectInterfacePropsClasses, ancestorGlibNames, hasExposedMethod, isIntrinsicElementClass, collectIntrinsicElementClasses, type GlibNamedClass, type ResolvedQualifiedInterface, type HasContainerProps, };
|
|
27
|
+
//# sourceMappingURL=intrinsic-elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intrinsic-elements.d.ts","sourceRoot":"","sources":["../../../src/store/jsx/intrinsic-elements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,KAAK,cAAc,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,YAAY,CAAC;CAC3B,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,YAAY,CAAA;CAAE,CAAC;AAQ/E,KAAK,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;AAUnE,QAAA,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,MAA0D,CAAC;AAc3G,iBAAU,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAIvF;AA0BD,Q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,EAC/B,KAAK,iBAAiB,GACzB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { sortStringsBy, toCamelIdentifier, upperFirst } from "@gtkx/utils";
|
|
2
|
+
import { ancestorChain } from "../../gir/ancestry.js";
|
|
3
|
+
const signalHandlerName = (signalName) => `on${upperFirst(toCamelIdentifier(signalName))}`;
|
|
4
|
+
function* classesWithGlibNameIn(namespace) {
|
|
5
|
+
for (const klass of namespace.classes) {
|
|
6
|
+
const glibName = getGlibName(klass);
|
|
7
|
+
if (glibName === undefined) {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
yield { glibName, klass, namespace };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function* iterateClassesWithGlibName(library) {
|
|
14
|
+
for (const namespace of library.namespaces.values()) {
|
|
15
|
+
yield* classesWithGlibNameIn(namespace);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function collectImplementedInterface(state, name, fromNamespace) {
|
|
19
|
+
const resolved = state.library.resolveType(fromNamespace.name, name);
|
|
20
|
+
if (resolved?.kind !== "interface") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const key = `${resolved.namespace.name}.${resolved.value.name}`;
|
|
24
|
+
if (state.visited.has(key)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
state.visited.add(key);
|
|
28
|
+
state.result.push({ klass: resolved.value, namespace: resolved.namespace });
|
|
29
|
+
visitImplementedInterfaces(state, resolved.value.prerequisites, resolved.namespace);
|
|
30
|
+
}
|
|
31
|
+
function visitImplementedInterfaces(state, names, fromNamespace) {
|
|
32
|
+
for (const name of names) {
|
|
33
|
+
collectImplementedInterface(state, name, fromNamespace);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const implementedInterfaces = (klass, namespace, library) => {
|
|
37
|
+
const state = { library, visited: new Set(), result: [] };
|
|
38
|
+
visitImplementedInterfaces(state, klass.implements, namespace);
|
|
39
|
+
return state.result;
|
|
40
|
+
};
|
|
41
|
+
const getGlibName = (klass) => klass.glibTypeName ?? klass.cType;
|
|
42
|
+
const giNamespaceAlias = (namespaceName) => `${namespaceName}$`;
|
|
43
|
+
const hasNoContainerProps = () => false;
|
|
44
|
+
const hasInterfacePropsBody = (klass, hasContainerProps = hasNoContainerProps) => klass.properties.length > 0 || klass.signals.length > 0 || hasContainerProps(getGlibName(klass));
|
|
45
|
+
const qualifiedInterfaceKey = (iface) => `${iface.namespace.name}.${iface.klass.name}`;
|
|
46
|
+
const isCollectibleInterface = (iface, targetNamespaceName, hasContainerProps) => hasInterfacePropsBody(iface.klass, hasContainerProps) && iface.namespace.name === targetNamespaceName;
|
|
47
|
+
const parentImplementedInterfaceKeys = (klass, namespace, library) => {
|
|
48
|
+
const keys = new Set();
|
|
49
|
+
if (klass.parent === undefined) {
|
|
50
|
+
return keys;
|
|
51
|
+
}
|
|
52
|
+
const resolvedParent = library.resolveType(namespace.name, klass.parent);
|
|
53
|
+
if (resolvedParent?.kind !== "class") {
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
56
|
+
for (const iface of implementedInterfaces(resolvedParent.value, resolvedParent.namespace, library)) {
|
|
57
|
+
keys.add(qualifiedInterfaceKey(iface));
|
|
58
|
+
}
|
|
59
|
+
return keys;
|
|
60
|
+
};
|
|
61
|
+
const newlyImplementedInterfaces = (klass, namespace, library, hasContainerProps = hasNoContainerProps) => {
|
|
62
|
+
const inherited = parentImplementedInterfaceKeys(klass, namespace, library);
|
|
63
|
+
const own = implementedInterfaces(klass, namespace, library).filter((iface) => hasInterfacePropsBody(iface.klass, hasContainerProps) && !inherited.has(qualifiedInterfaceKey(iface)));
|
|
64
|
+
return sortStringsBy(own, qualifiedInterfaceKey);
|
|
65
|
+
};
|
|
66
|
+
const collectInterfacePropsFromElement = (element, collector) => {
|
|
67
|
+
const { library, targetNamespaceName, hasContainerProps, seen, result } = collector;
|
|
68
|
+
for (const iface of implementedInterfaces(element.klass, element.namespace, library)) {
|
|
69
|
+
const key = qualifiedInterfaceKey(iface);
|
|
70
|
+
if (seen.has(key)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
seen.add(key);
|
|
74
|
+
if (isCollectibleInterface(iface, targetNamespaceName, hasContainerProps)) {
|
|
75
|
+
result.push(iface);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const collectInterfacePropsClasses = (library, intrinsicElements, targetNamespaceName, hasContainerProps = hasNoContainerProps) => {
|
|
80
|
+
const collector = {
|
|
81
|
+
library,
|
|
82
|
+
targetNamespaceName,
|
|
83
|
+
hasContainerProps,
|
|
84
|
+
seen: new Set(),
|
|
85
|
+
result: [],
|
|
86
|
+
};
|
|
87
|
+
for (const element of intrinsicElements) {
|
|
88
|
+
collectInterfacePropsFromElement(element, collector);
|
|
89
|
+
}
|
|
90
|
+
return sortStringsBy(collector.result, qualifiedInterfaceKey);
|
|
91
|
+
};
|
|
92
|
+
const ancestorGlibNames = (klass, namespace, library) => {
|
|
93
|
+
const names = [];
|
|
94
|
+
for (const { klass: ancestor } of ancestorChain(library, klass, namespace.name)) {
|
|
95
|
+
const glibName = getGlibName(ancestor);
|
|
96
|
+
if (glibName !== undefined) {
|
|
97
|
+
names.push(glibName);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return names;
|
|
101
|
+
};
|
|
102
|
+
const hasMatchingAncestor = (klass, namespace, library, isMatch) => {
|
|
103
|
+
for (const { klass: ancestor } of ancestorChain(library, klass, namespace.name)) {
|
|
104
|
+
const glibName = getGlibName(ancestor) ?? "";
|
|
105
|
+
if (isMatch(ancestor, glibName)) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
};
|
|
111
|
+
const hasMatchingAncestorName = (klass, namespace, library, isMatch) => hasMatchingAncestor(klass, namespace, library, (_klass, glibName) => isMatch(glibName));
|
|
112
|
+
const hasExposedMethod = (klass, namespace, library, methodName) => hasMatchingAncestor(klass, namespace, library, (current) => current.methods.some((m) => m.name === methodName));
|
|
113
|
+
const isIntrinsicElementClass = (klass, namespace, library) => hasMatchingAncestorName(klass, namespace, library, (glibName) => glibName === "GObject");
|
|
114
|
+
const collectIntrinsicElementClasses = (library) => {
|
|
115
|
+
const seen = new Set();
|
|
116
|
+
const entries = [];
|
|
117
|
+
for (const candidate of iterateClassesWithGlibName(library)) {
|
|
118
|
+
const { glibName, klass, namespace } = candidate;
|
|
119
|
+
if (!isIntrinsicElementClass(klass, namespace, library) || seen.has(glibName)) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
seen.add(glibName);
|
|
123
|
+
entries.push(candidate);
|
|
124
|
+
}
|
|
125
|
+
return sortStringsBy(entries, (entry) => entry.glibName);
|
|
126
|
+
};
|
|
127
|
+
export { signalHandlerName, iterateClassesWithGlibName, implementedInterfaces, getGlibName, giNamespaceAlias, hasInterfacePropsBody, newlyImplementedInterfaces, collectInterfacePropsClasses, ancestorGlibNames, hasExposedMethod, isIntrinsicElementClass, collectIntrinsicElementClasses, };
|
|
128
|
+
//# sourceMappingURL=intrinsic-elements.js.map
|