@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
|
@@ -2,23 +2,12 @@ import { sortStringsBy, toCamelIdentifier, upperFirst } from "@gtkx/utils";
|
|
|
2
2
|
import { ancestorChain } from "../gir/ancestry.js";
|
|
3
3
|
import { namespaceDirectory } from "../gir/namespace.js";
|
|
4
4
|
import { isConstructableProperty } from "../gir/property.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
export const createElementPageContext = (library, elementProps, linkFor) => {
|
|
12
|
-
const girIndex = buildGirIndex(library);
|
|
13
|
-
const applied = assembleElementProps(girIndex, elementProps);
|
|
14
|
-
return {
|
|
15
|
-
library,
|
|
16
|
-
girIndex,
|
|
17
|
-
typegen: createElementPropTypegen(girIndex, applied),
|
|
18
|
-
elementProps: applied,
|
|
19
|
-
linkFor,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
5
|
+
import { elementPropTypeFor } from "../store/jsx/element-prop-imports.js";
|
|
6
|
+
import { buildGirIndex } from "../store/jsx/gir-index.js";
|
|
7
|
+
import { getGlibName, implementedInterfaces, newlyImplementedInterfaces, signalHandlerName, } from "../store/jsx/intrinsic-elements.js";
|
|
8
|
+
import { isObjectProp } from "../store/jsx/props.js";
|
|
9
|
+
import { classMethodEntries, docMarkdown, docsDefaultValue, firstSentence, implementsLine, joinSections, metaBlock, methodsSectionBlocks, originSignatureBlocks, renderDocsSignalSignature, renderDocsType, } from "./render.js";
|
|
10
|
+
const createElementPageContext = (library, linkFor) => ({ library, girIndex: buildGirIndex(library), linkFor });
|
|
22
11
|
const frontmatter = (entry) => {
|
|
23
12
|
const sentence = firstSentence(entry.klass.doc);
|
|
24
13
|
const description = sentence.length > 0 ? sentence : `API reference for the ${entry.glibName} element.`;
|
|
@@ -30,181 +19,127 @@ const glibLabel = (context, glibName) => {
|
|
|
30
19
|
return link === undefined ? `\`${glibName}\`` : `[${glibName}](${link})`;
|
|
31
20
|
};
|
|
32
21
|
const hierarchySection = (entry, context) => {
|
|
33
|
-
const ancestors = [...ancestorChain(context.library, entry.klass, entry.namespace.name)].slice(1).
|
|
34
|
-
if (ancestors.length === 0)
|
|
22
|
+
const ancestors = [...ancestorChain(context.library, entry.klass, entry.namespace.name)].slice(1).toReversed();
|
|
23
|
+
if (ancestors.length === 0) {
|
|
35
24
|
return [];
|
|
25
|
+
}
|
|
36
26
|
const parts = ancestors.map((ancestor) => {
|
|
37
|
-
const glib =
|
|
27
|
+
const glib = getGlibName(ancestor.klass);
|
|
38
28
|
return glib === undefined ? `\`${ancestor.namespaceName}.${ancestor.klass.name}\`` : glibLabel(context, glib);
|
|
39
29
|
});
|
|
40
30
|
parts.push(`**${entry.glibName}**`);
|
|
41
|
-
const lines = [
|
|
31
|
+
const lines = ["## Hierarchy", parts.join(" → ")];
|
|
42
32
|
const interfaces = implementedInterfaces(entry.klass, entry.namespace, context.library)
|
|
43
|
-
.map((iface) =>
|
|
33
|
+
.map((iface) => getGlibName(iface.klass))
|
|
44
34
|
.filter((name) => name !== undefined);
|
|
45
|
-
|
|
46
|
-
lines.push(`Implements ${interfaces.map((name) => `\`${name}\``).join(", ")}.`);
|
|
47
|
-
}
|
|
35
|
+
lines.push(...implementsLine(interfaces));
|
|
48
36
|
return lines;
|
|
49
37
|
};
|
|
50
|
-
const callName = (call) => call === undefined ? undefined : typeof call === "string" ? call : call.method;
|
|
51
|
-
const containerLine = (prop, context) => {
|
|
52
|
-
const child = glibLabel(context, prop.child);
|
|
53
|
-
const attach = callName(prop.append);
|
|
54
|
-
const detail = [];
|
|
55
|
-
if (attach !== undefined)
|
|
56
|
-
detail.push(`attached with \`${attach}()\``);
|
|
57
|
-
if (prop.autowrap !== undefined) {
|
|
58
|
-
detail.push(`children are wrapped in a ${glibLabel(context, prop.autowrap)} before attaching`);
|
|
59
|
-
}
|
|
60
|
-
const suffix = detail.length > 0 ? ` (${detail.join("; ")})` : "";
|
|
61
|
-
if (prop.prop === "children")
|
|
62
|
-
return `- \`children\` accepts ${child} elements${suffix}.`;
|
|
63
|
-
return `- \`${prop.prop}\` is a slot accepting ${child} elements${suffix}.`;
|
|
64
|
-
};
|
|
65
|
-
const childrenSection = (entry, context) => {
|
|
66
|
-
const lines = [];
|
|
67
|
-
const seen = new Set();
|
|
68
|
-
for (const owner of memberOwners(entry, context)) {
|
|
69
|
-
if (owner.glibName === undefined)
|
|
70
|
-
continue;
|
|
71
|
-
const overlays = context.elementProps[owner.glibName] ?? [];
|
|
72
|
-
const containers = overlays.filter((prop) => prop.kind === "container" && !seen.has(prop.prop));
|
|
73
|
-
for (const prop of containers)
|
|
74
|
-
lines.push(containerLine(prop, context));
|
|
75
|
-
for (const prop of containers)
|
|
76
|
-
seen.add(prop.prop);
|
|
77
|
-
}
|
|
78
|
-
if (!seen.has("children") && context.typegen.acceptsChildren(entry.glibName)) {
|
|
79
|
-
lines.push("- `children` accepts child elements.");
|
|
80
|
-
}
|
|
81
|
-
if (lines.length === 0)
|
|
82
|
-
return [];
|
|
83
|
-
return ["## Children", lines.join("\n")];
|
|
84
|
-
};
|
|
85
38
|
const memberOwners = (entry, context) => [
|
|
86
39
|
{ klass: entry.klass, namespace: entry.namespace, origin: undefined, glibName: entry.glibName },
|
|
87
|
-
...newlyImplementedInterfaces(entry.klass, entry.namespace, context.library, (glibName) => glibName !== undefined &&
|
|
88
|
-
const glibName =
|
|
40
|
+
...newlyImplementedInterfaces(entry.klass, entry.namespace, context.library, (glibName) => glibName !== undefined && elementPropTypeFor(glibName) !== undefined).map((iface) => {
|
|
41
|
+
const glibName = getGlibName(iface.klass);
|
|
89
42
|
return { klass: iface.klass, namespace: iface.namespace, origin: glibName, glibName };
|
|
90
43
|
}),
|
|
91
44
|
];
|
|
92
45
|
const propertyEntry = (context, owner, property, jsName) => {
|
|
93
|
-
const
|
|
46
|
+
const isObject = isObjectProp({ library: context.library, klass: owner.klass, namespace: owner.namespace }, property, jsName);
|
|
94
47
|
const baseType = renderDocsType(context.library, property.type, false);
|
|
95
|
-
const type =
|
|
48
|
+
const type = isObject ? `${baseType} | ReactElement` : baseType;
|
|
96
49
|
const meta = [`\`${type}\``];
|
|
97
|
-
if (property.defaultValue !== undefined)
|
|
50
|
+
if (property.defaultValue !== undefined) {
|
|
98
51
|
meta.push(`default \`${docsDefaultValue(property.defaultValue)}\``);
|
|
99
|
-
|
|
52
|
+
}
|
|
53
|
+
if (property.constructOnly) {
|
|
100
54
|
meta.push("construct-only");
|
|
101
|
-
|
|
55
|
+
}
|
|
56
|
+
if (!isConstructableProperty(property)) {
|
|
102
57
|
meta.push(`read-only, observe with \`onNotify${upperFirst(jsName)}\``);
|
|
103
|
-
|
|
58
|
+
}
|
|
59
|
+
if (owner.origin !== undefined) {
|
|
104
60
|
meta.push(`from \`${owner.origin}\``);
|
|
61
|
+
}
|
|
105
62
|
return { name: jsName, meta: meta.join(" · "), doc: docMarkdown(property.doc) };
|
|
106
63
|
};
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const applied = (Array.isArray(overlay.add) ? overlay.add : [overlay.add])
|
|
115
|
-
.map((call) => `\`${callName(call)}()\``)
|
|
116
|
-
.join(", ");
|
|
117
|
-
return `Array prop; items are applied with ${applied}.`;
|
|
118
|
-
}
|
|
119
|
-
if (overlay.kind === "controlled-text") {
|
|
120
|
-
return "Controlled: the element is synced to the prop value whenever that value changes; text the user has typed is preserved rather than reverted on every render.";
|
|
121
|
-
}
|
|
64
|
+
const propJsName = (property, seen) => {
|
|
65
|
+
if (!property.introspectable) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const jsName = toCamelIdentifier(property.name);
|
|
69
|
+
if (seen.has(jsName)) {
|
|
70
|
+
return undefined;
|
|
122
71
|
}
|
|
123
|
-
|
|
72
|
+
seen.add(jsName);
|
|
73
|
+
return jsName;
|
|
124
74
|
};
|
|
125
|
-
const
|
|
126
|
-
const overlayEntries = (entry, context, seen) => {
|
|
127
|
-
const overlays = context.elementProps[entry.glibName] ?? [];
|
|
75
|
+
const ownerPropEntries = (context, owner, seen) => {
|
|
128
76
|
const entries = [];
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const [, name = "", rawType = ""] = match;
|
|
135
|
-
if (seen.has(name))
|
|
136
|
-
continue;
|
|
137
|
-
seen.add(name);
|
|
138
|
-
const note = overlayNote(overlays, name) ?? "Element prop managed by GTKX.";
|
|
139
|
-
entries.push({ name, meta: `\`${cleanOverlayType(rawType)}\``, doc: note });
|
|
77
|
+
for (const property of owner.klass.properties) {
|
|
78
|
+
const jsName = propJsName(property, seen);
|
|
79
|
+
if (jsName !== undefined) {
|
|
80
|
+
entries.push(propertyEntry(context, owner, property, jsName));
|
|
81
|
+
}
|
|
140
82
|
}
|
|
141
83
|
return entries;
|
|
142
84
|
};
|
|
143
|
-
const withOverlayNote = (propEntry, note) => {
|
|
144
|
-
if (note === undefined)
|
|
145
|
-
return propEntry;
|
|
146
|
-
return { ...propEntry, doc: propEntry.doc.length > 0 ? `${note}\n\n${propEntry.doc}` : note };
|
|
147
|
-
};
|
|
148
85
|
const propertyEntries = (entry, context, seen) => {
|
|
149
|
-
const owners = memberOwners(entry, context);
|
|
150
|
-
const overlays = owners.flatMap((owner) => owner.glibName === undefined ? [] : (context.elementProps[owner.glibName] ?? []));
|
|
151
86
|
const entries = [];
|
|
152
|
-
for (const owner of
|
|
153
|
-
|
|
154
|
-
if (!property.introspectable)
|
|
155
|
-
continue;
|
|
156
|
-
const jsName = toCamelIdentifier(property.name);
|
|
157
|
-
if (seen.has(jsName))
|
|
158
|
-
continue;
|
|
159
|
-
seen.add(jsName);
|
|
160
|
-
const propEntry = propertyEntry(context, owner, property, jsName);
|
|
161
|
-
entries.push(withOverlayNote(propEntry, overlayNote(overlays, jsName)));
|
|
162
|
-
}
|
|
87
|
+
for (const owner of memberOwners(entry, context)) {
|
|
88
|
+
entries.push(...ownerPropEntries(context, owner, seen));
|
|
163
89
|
}
|
|
164
90
|
return entries;
|
|
165
91
|
};
|
|
166
92
|
const propsSection = (entry, context, selfType) => {
|
|
167
93
|
const seen = new Set();
|
|
168
|
-
const entries =
|
|
94
|
+
const entries = propertyEntries(entry, context, seen);
|
|
169
95
|
const intro = [
|
|
170
96
|
`\`ref\` receives the \`${selfType}\` instance.`,
|
|
171
|
-
|
|
172
|
-
|
|
97
|
+
"Every mutable property also has an `onNotify<Prop>` handler prop called with the new value " +
|
|
98
|
+
"when the property changes.",
|
|
99
|
+
"Props inherited from ancestor elements are documented on their own pages.",
|
|
173
100
|
].join(" ");
|
|
174
|
-
if (entries.length === 0)
|
|
101
|
+
if (entries.length === 0) {
|
|
175
102
|
return ["## Props", intro];
|
|
103
|
+
}
|
|
176
104
|
const sorted = sortStringsBy(entries, (item) => item.name);
|
|
177
105
|
return ["## Props", intro, ...sorted.map((item) => metaBlock(item.name, item.meta, item.doc))];
|
|
178
106
|
};
|
|
179
|
-
const
|
|
180
|
-
const seen = new Set();
|
|
107
|
+
const ownerSignalEntries = (context, owner, selfType, seen) => {
|
|
181
108
|
const entries = [];
|
|
182
|
-
const
|
|
109
|
+
for (const signal of owner.klass.signals) {
|
|
183
110
|
const name = signalHandlerName(signal.name);
|
|
184
|
-
if (seen.has(name))
|
|
185
|
-
|
|
111
|
+
if (seen.has(name)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
186
114
|
seen.add(name);
|
|
187
115
|
entries.push({
|
|
188
116
|
name,
|
|
189
117
|
signature: renderDocsSignalSignature(context.library, signal, selfType),
|
|
190
118
|
doc: docMarkdown(signal.doc),
|
|
191
|
-
origin,
|
|
119
|
+
origin: owner.origin,
|
|
192
120
|
});
|
|
193
|
-
}
|
|
121
|
+
}
|
|
122
|
+
return entries;
|
|
123
|
+
};
|
|
124
|
+
const signalsSection = (entry, context, selfType) => {
|
|
125
|
+
const seen = new Set();
|
|
126
|
+
const entries = [];
|
|
194
127
|
for (const owner of memberOwners(entry, context)) {
|
|
195
|
-
|
|
196
|
-
acceptSignal(signal, owner.origin);
|
|
128
|
+
entries.push(...ownerSignalEntries(context, owner, selfType, seen));
|
|
197
129
|
}
|
|
198
|
-
if (entries.length === 0)
|
|
130
|
+
if (entries.length === 0) {
|
|
199
131
|
return [];
|
|
132
|
+
}
|
|
200
133
|
return ["## Signals", ...originSignatureBlocks(entries)];
|
|
201
134
|
};
|
|
202
135
|
const methodsSection = (entry, context, selfType) => {
|
|
203
136
|
const entries = classMethodEntries(context.library, entry.namespace, entry.klass);
|
|
204
|
-
const
|
|
137
|
+
const importPath = `@gtkx/gi/${namespaceDirectory(entry.namespace)}`;
|
|
138
|
+
const intro = `Methods are called on the \`${selfType}\` instance, obtained with the \`ref\` prop or ` +
|
|
139
|
+
`imported from \`${importPath}\`. Methods inherited from ancestors are documented on their own pages.`;
|
|
205
140
|
return methodsSectionBlocks(entries, intro);
|
|
206
141
|
};
|
|
207
|
-
|
|
142
|
+
const renderElementPage = (entry, context) => {
|
|
208
143
|
const selfType = `${entry.namespace.name}.${entry.klass.name}`;
|
|
209
144
|
return joinSections([
|
|
210
145
|
frontmatter(entry),
|
|
@@ -212,10 +147,10 @@ export const renderElementPage = (entry, context) => {
|
|
|
212
147
|
docMarkdown(entry.klass.doc),
|
|
213
148
|
importBlock(entry),
|
|
214
149
|
...hierarchySection(entry, context),
|
|
215
|
-
...childrenSection(entry, context),
|
|
216
150
|
...propsSection(entry, context, selfType),
|
|
217
151
|
...signalsSection(entry, context, selfType),
|
|
218
152
|
...methodsSection(entry, context, selfType),
|
|
219
153
|
]);
|
|
220
154
|
};
|
|
155
|
+
export { createElementPageContext, renderElementPage };
|
|
221
156
|
//# sourceMappingURL=element-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-page.js","sourceRoot":"","sources":["../../src/docs/element-page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAqB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAoB,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAA2B,MAAM,sCAAsC,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AAE,QAAgB,EAAY,EAAE;IACtG,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClF,MAAM,KAAK,GAAG,+BAA+B,QAAQ,2EAA2E,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,yEAAyE,CAAC;IAC7O,OAAO,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAE,OAA2B,EAAU,EAAE;IAC5F,MAAM,QAAQ,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/D,OAAO,YAAY,CAAC;QAChB,WAAW,CAAC,KAAK,CAAC;QAClB,KAAK,KAAK,CAAC,QAAQ,EAAE;QACrB,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;QAC5B,WAAW,CAAC,KAAK,CAAC;QAClB,GAAG,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;QACnC,GAAG,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;QAClC,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;QACzC,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;QAC3C,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;KAC9C,CAAC,CAAC;AACP,CAAC,CAAC","sourcesContent":["import type { ContainerProp, ElementProp } from \"@gtkx/config\";\nimport { sortStringsBy, toCamelIdentifier, upperFirst } from \"@gtkx/utils\";\nimport { ancestorChain } from \"../gir/ancestry.js\";\nimport type { GirClass } from \"../gir/class.js\";\nimport type { Library } from \"../gir/library.js\";\nimport { type GirNamespace, namespaceDirectory } from \"../gir/namespace.js\";\nimport type { GirSignal } from \"../gir/parameter.js\";\nimport { type GirProperty, isConstructableProperty } from \"../gir/property.js\";\nimport { createElementPropTypegen, type ElementPropTypegen } from \"../store/react/element-prop-types.js\";\nimport { assembleElementProps } from \"../store/react/element-props.js\";\nimport { buildGirIndex, type GirIndex } from \"../store/react/gir-index.js\";\nimport {\n type GlibNamedClass,\n glibNameOf,\n implementedInterfaces,\n newlyImplementedInterfaces,\n signalHandlerName,\n} from \"../store/react/intrinsic-elements.js\";\nimport { isObjectProp } from \"../store/react/props.js\";\nimport {\n classMethodEntries,\n docMarkdown,\n docsDefaultValue,\n firstSentence,\n joinSections,\n metaBlock,\n methodsSectionBlocks,\n originSignatureBlocks,\n renderDocsSignalSignature,\n renderDocsType,\n} from \"./render.js\";\n\nexport type ElementPageContext = {\n library: Library;\n girIndex: GirIndex;\n typegen: ElementPropTypegen;\n elementProps: Record<string, ElementProp[]>;\n linkFor: (glibName: string) => string | undefined;\n};\n\nexport const createElementPageContext = (\n library: Library,\n elementProps: Record<string, ElementProp[]>,\n linkFor: (glibName: string) => string | undefined,\n): ElementPageContext => {\n const girIndex = buildGirIndex(library);\n const applied = assembleElementProps(girIndex, elementProps);\n return {\n library,\n girIndex,\n typegen: createElementPropTypegen(girIndex, applied),\n elementProps: applied,\n linkFor,\n };\n};\n\ntype MemberOwner = {\n klass: GirClass;\n namespace: GirNamespace;\n origin: string | undefined;\n glibName: string | undefined;\n};\n\ntype PropEntry = {\n name: string;\n meta: string;\n doc: string;\n};\n\nconst frontmatter = (entry: GlibNamedClass): string => {\n const sentence = firstSentence(entry.klass.doc);\n const description = sentence.length > 0 ? sentence : `API reference for the ${entry.glibName} element.`;\n return `---\\ndescription: ${JSON.stringify(description)}\\n---`;\n};\n\nconst importBlock = (entry: GlibNamedClass): string =>\n `\\`\\`\\`tsx\\nimport { ${entry.glibName} } from \"@gtkx/jsx/${namespaceDirectory(entry.namespace)}\";\\n\\`\\`\\``;\n\nconst glibLabel = (context: ElementPageContext, glibName: string): string => {\n const link = context.linkFor(glibName);\n return link === undefined ? `\\`${glibName}\\`` : `[${glibName}](${link})`;\n};\n\nconst hierarchySection = (entry: GlibNamedClass, context: ElementPageContext): string[] => {\n const ancestors = [...ancestorChain(context.library, entry.klass, entry.namespace.name)].slice(1).reverse();\n if (ancestors.length === 0) return [];\n const parts = ancestors.map((ancestor) => {\n const glib = glibNameOf(ancestor.klass);\n return glib === undefined ? `\\`${ancestor.namespaceName}.${ancestor.klass.name}\\`` : glibLabel(context, glib);\n });\n parts.push(`**${entry.glibName}**`);\n const lines = [`## Hierarchy`, parts.join(\" → \")];\n const interfaces = implementedInterfaces(entry.klass, entry.namespace, context.library)\n .map((iface) => glibNameOf(iface.klass))\n .filter((name): name is string => name !== undefined);\n if (interfaces.length > 0) {\n lines.push(`Implements ${interfaces.map((name) => `\\`${name}\\``).join(\", \")}.`);\n }\n return lines;\n};\n\nconst callName = (call: ContainerProp[\"append\"]): string | undefined =>\n call === undefined ? undefined : typeof call === \"string\" ? call : call.method;\n\nconst containerLine = (prop: ContainerProp, context: ElementPageContext): string => {\n const child = glibLabel(context, prop.child);\n const attach = callName(prop.append);\n const detail: string[] = [];\n if (attach !== undefined) detail.push(`attached with \\`${attach}()\\``);\n if (prop.autowrap !== undefined) {\n detail.push(`children are wrapped in a ${glibLabel(context, prop.autowrap)} before attaching`);\n }\n const suffix = detail.length > 0 ? ` (${detail.join(\"; \")})` : \"\";\n if (prop.prop === \"children\") return `- \\`children\\` accepts ${child} elements${suffix}.`;\n return `- \\`${prop.prop}\\` is a slot accepting ${child} elements${suffix}.`;\n};\n\nconst childrenSection = (entry: GlibNamedClass, context: ElementPageContext): string[] => {\n const lines: string[] = [];\n const seen = new Set<string>();\n for (const owner of memberOwners(entry, context)) {\n if (owner.glibName === undefined) continue;\n const overlays = context.elementProps[owner.glibName] ?? [];\n const containers = overlays.filter(\n (prop): prop is ContainerProp => prop.kind === \"container\" && !seen.has(prop.prop),\n );\n for (const prop of containers) lines.push(containerLine(prop, context));\n for (const prop of containers) seen.add(prop.prop);\n }\n if (!seen.has(\"children\") && context.typegen.acceptsChildren(entry.glibName)) {\n lines.push(\"- `children` accepts child elements.\");\n }\n if (lines.length === 0) return [];\n return [\"## Children\", lines.join(\"\\n\")];\n};\n\nconst memberOwners = (entry: GlibNamedClass, context: ElementPageContext): MemberOwner[] => [\n { klass: entry.klass, namespace: entry.namespace, origin: undefined, glibName: entry.glibName },\n ...newlyImplementedInterfaces(\n entry.klass,\n entry.namespace,\n context.library,\n (glibName) => glibName !== undefined && context.typegen.containerPropNamesFor(glibName).length > 0,\n ).map((iface) => {\n const glibName = glibNameOf(iface.klass);\n return { klass: iface.klass, namespace: iface.namespace, origin: glibName, glibName };\n }),\n];\n\nconst propertyEntry = (\n context: ElementPageContext,\n owner: MemberOwner,\n property: GirProperty,\n jsName: string,\n): PropEntry => {\n const object = isObjectProp(\n { library: context.library, klass: owner.klass, namespace: owner.namespace },\n property,\n jsName,\n );\n const baseType = renderDocsType(context.library, property.type, false);\n const type = object ? `${baseType} | ReactElement` : baseType;\n const meta: string[] = [`\\`${type}\\``];\n if (property.defaultValue !== undefined) meta.push(`default \\`${docsDefaultValue(property.defaultValue)}\\``);\n if (property.constructOnly) meta.push(\"construct-only\");\n if (!isConstructableProperty(property)) meta.push(`read-only, observe with \\`onNotify${upperFirst(jsName)}\\``);\n if (owner.origin !== undefined) meta.push(`from \\`${owner.origin}\\``);\n return { name: jsName, meta: meta.join(\" · \"), doc: docMarkdown(property.doc) };\n};\n\nconst overlayNote = (overlays: ElementProp[], name: string): string | undefined => {\n for (const overlay of overlays) {\n if (overlay.kind === \"container\" || overlay.prop !== name) continue;\n if (overlay.kind === \"value\") return `Applied with \\`${callName(overlay.call)}()\\`.`;\n if (overlay.kind === \"list\") {\n const applied = (Array.isArray(overlay.add) ? overlay.add : [overlay.add])\n .map((call) => `\\`${callName(call)}()\\``)\n .join(\", \");\n return `Array prop; items are applied with ${applied}.`;\n }\n if (overlay.kind === \"controlled-text\") {\n return \"Controlled: the element is synced to the prop value whenever that value changes; text the user has typed is preserved rather than reverted on every render.\";\n }\n }\n return undefined;\n};\n\nconst cleanOverlayType = (type: string): string => type.replace(/\\s*\\|\\s*undefined$/, \"\").replaceAll(\"$.\", \".\");\n\nconst overlayEntries = (entry: GlibNamedClass, context: ElementPageContext, seen: Set<string>): PropEntry[] => {\n const overlays = context.elementProps[entry.glibName] ?? [];\n const entries: PropEntry[] = [];\n const lines = context.typegen.classPropLines(entry.glibName, entry.klass, entry.namespace, new Map());\n for (const line of lines) {\n const match = line.match(/^([A-Za-z0-9_]+)\\?: (.*);$/);\n if (match === null) continue;\n const [, name = \"\", rawType = \"\"] = match;\n if (seen.has(name)) continue;\n seen.add(name);\n const note = overlayNote(overlays, name) ?? \"Element prop managed by GTKX.\";\n entries.push({ name, meta: `\\`${cleanOverlayType(rawType)}\\``, doc: note });\n }\n return entries;\n};\n\nconst withOverlayNote = (propEntry: PropEntry, note: string | undefined): PropEntry => {\n if (note === undefined) return propEntry;\n return { ...propEntry, doc: propEntry.doc.length > 0 ? `${note}\\n\\n${propEntry.doc}` : note };\n};\n\nconst propertyEntries = (entry: GlibNamedClass, context: ElementPageContext, seen: Set<string>): PropEntry[] => {\n const owners = memberOwners(entry, context);\n const overlays = owners.flatMap((owner) =>\n owner.glibName === undefined ? [] : (context.elementProps[owner.glibName] ?? []),\n );\n const entries: PropEntry[] = [];\n for (const owner of owners) {\n for (const property of owner.klass.properties) {\n if (!property.introspectable) continue;\n const jsName = toCamelIdentifier(property.name);\n if (seen.has(jsName)) continue;\n seen.add(jsName);\n const propEntry = propertyEntry(context, owner, property, jsName);\n entries.push(withOverlayNote(propEntry, overlayNote(overlays, jsName)));\n }\n }\n return entries;\n};\n\nconst propsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const seen = new Set<string>();\n const entries = [...propertyEntries(entry, context, seen), ...overlayEntries(entry, context, seen)];\n const intro = [\n `\\`ref\\` receives the \\`${selfType}\\` instance.`,\n `Every mutable property also has an \\`onNotify<Prop>\\` handler prop called with the new value when the property changes.`,\n `Props inherited from ancestor elements are documented on their own pages.`,\n ].join(\" \");\n if (entries.length === 0) return [\"## Props\", intro];\n const sorted = sortStringsBy(entries, (item) => item.name);\n return [\"## Props\", intro, ...sorted.map((item) => metaBlock(item.name, item.meta, item.doc))];\n};\n\ntype SignalEntry = {\n name: string;\n signature: string;\n doc: string;\n origin: string | undefined;\n};\n\nconst signalsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const seen = new Set<string>();\n const entries: SignalEntry[] = [];\n const acceptSignal = (signal: GirSignal, origin: string | undefined): void => {\n const name = signalHandlerName(signal.name);\n if (seen.has(name)) return;\n seen.add(name);\n entries.push({\n name,\n signature: renderDocsSignalSignature(context.library, signal, selfType),\n doc: docMarkdown(signal.doc),\n origin,\n });\n };\n for (const owner of memberOwners(entry, context)) {\n for (const signal of owner.klass.signals) acceptSignal(signal, owner.origin);\n }\n if (entries.length === 0) return [];\n return [\"## Signals\", ...originSignatureBlocks(entries)];\n};\n\nconst methodsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const entries = classMethodEntries(context.library, entry.namespace, entry.klass);\n const intro = `Methods are called on the \\`${selfType}\\` instance, obtained with the \\`ref\\` prop or imported from \\`@gtkx/gi/${namespaceDirectory(entry.namespace)}\\`. Methods inherited from ancestors are documented on their own pages.`;\n return methodsSectionBlocks(entries, intro);\n};\n\nexport const renderElementPage = (entry: GlibNamedClass, context: ElementPageContext): string => {\n const selfType = `${entry.namespace.name}.${entry.klass.name}`;\n return joinSections([\n frontmatter(entry),\n `# ${entry.glibName}`,\n docMarkdown(entry.klass.doc),\n importBlock(entry),\n ...hierarchySection(entry, context),\n ...childrenSection(entry, context),\n ...propsSection(entry, context, selfType),\n ...signalsSection(entry, context, selfType),\n ...methodsSection(entry, context, selfType),\n ]);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"element-page.js","sourceRoot":"","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AAK,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAE/D,OAAO,YAAY,CAAC;QAChB,WAAW,CAAC,KAAK,CAAC;QAClB,KAAK,KAAK,CAAC,QAAQ,EAAE;QACrB,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;QAC5B,WAAW,CAAC,KAAK,CAAC;QAClB,GAAG,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;QACnC,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;QACzC,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;QAC3C,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;KAC9C,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAA2B,CAAC","sourcesContent":["import { sortStringsBy, toCamelIdentifier, upperFirst } from \"@gtkx/utils\";\nimport type { GirClass } from \"../gir/class.js\";\nimport type { Library } from \"../gir/library.js\";\nimport { ancestorChain } from \"../gir/ancestry.js\";\nimport { type GirNamespace, namespaceDirectory } from \"../gir/namespace.js\";\nimport { type GirProperty, isConstructableProperty } from \"../gir/property.js\";\nimport { elementPropTypeFor } from \"../store/jsx/element-prop-imports.js\";\nimport { buildGirIndex, type GirIndex } from \"../store/jsx/gir-index.js\";\nimport {\n getGlibName,\n type GlibNamedClass,\n implementedInterfaces,\n newlyImplementedInterfaces,\n signalHandlerName,\n} from \"../store/jsx/intrinsic-elements.js\";\nimport { isObjectProp } from \"../store/jsx/props.js\";\nimport {\n classMethodEntries,\n docMarkdown,\n docsDefaultValue,\n firstSentence,\n implementsLine,\n joinSections,\n metaBlock,\n methodsSectionBlocks,\n originSignatureBlocks,\n renderDocsSignalSignature,\n renderDocsType,\n} from \"./render.js\";\n\ntype ElementPageContext = {\n library: Library;\n girIndex: GirIndex;\n linkFor: (glibName: string) => string | undefined;\n};\n\ntype MemberOwner = {\n klass: GirClass;\n namespace: GirNamespace;\n origin: string | undefined;\n glibName: string | undefined;\n};\n\ntype PropEntry = {\n name: string;\n meta: string;\n doc: string;\n};\n\ntype SignalEntry = {\n name: string;\n signature: string;\n doc: string;\n origin: string | undefined;\n};\n\nconst createElementPageContext = (\n library: Library,\n linkFor: (glibName: string) => string | undefined,\n): ElementPageContext => ({ library, girIndex: buildGirIndex(library), linkFor });\n\nconst frontmatter = (entry: GlibNamedClass): string => {\n const sentence = firstSentence(entry.klass.doc);\n const description = sentence.length > 0 ? sentence : `API reference for the ${entry.glibName} element.`;\n\n return `---\\ndescription: ${JSON.stringify(description)}\\n---`;\n};\n\nconst importBlock = (entry: GlibNamedClass): string =>\n `\\`\\`\\`tsx\\nimport { ${entry.glibName} } from \"@gtkx/jsx/${namespaceDirectory(entry.namespace)}\";\\n\\`\\`\\``;\n\nconst glibLabel = (context: ElementPageContext, glibName: string): string => {\n const link = context.linkFor(glibName);\n\n return link === undefined ? `\\`${glibName}\\`` : `[${glibName}](${link})`;\n};\n\nconst hierarchySection = (entry: GlibNamedClass, context: ElementPageContext): string[] => {\n const ancestors = [...ancestorChain(context.library, entry.klass, entry.namespace.name)].slice(1).toReversed();\n\n if (ancestors.length === 0) {\n return [];\n }\n\n const parts = ancestors.map((ancestor) => {\n const glib = getGlibName(ancestor.klass);\n\n return glib === undefined ? `\\`${ancestor.namespaceName}.${ancestor.klass.name}\\`` : glibLabel(context, glib);\n });\n\n parts.push(`**${entry.glibName}**`);\n const lines = [\"## Hierarchy\", parts.join(\" → \")];\n\n const interfaces = implementedInterfaces(entry.klass, entry.namespace, context.library)\n .map((iface) => getGlibName(iface.klass))\n .filter((name): name is string => name !== undefined);\n\n lines.push(...implementsLine(interfaces));\n\n return lines;\n};\n\nconst memberOwners = (entry: GlibNamedClass, context: ElementPageContext): MemberOwner[] => [\n { klass: entry.klass, namespace: entry.namespace, origin: undefined, glibName: entry.glibName },\n ...newlyImplementedInterfaces(\n entry.klass,\n entry.namespace,\n context.library,\n (glibName) => glibName !== undefined && elementPropTypeFor(glibName) !== undefined,\n ).map((iface) => {\n const glibName = getGlibName(iface.klass);\n\n return { klass: iface.klass, namespace: iface.namespace, origin: glibName, glibName };\n }),\n];\n\nconst propertyEntry = (\n context: ElementPageContext,\n owner: MemberOwner,\n property: GirProperty,\n jsName: string,\n): PropEntry => {\n const isObject = isObjectProp(\n { library: context.library, klass: owner.klass, namespace: owner.namespace },\n property,\n jsName,\n );\n\n const baseType = renderDocsType(context.library, property.type, false);\n const type = isObject ? `${baseType} | ReactElement` : baseType;\n const meta: string[] = [`\\`${type}\\``];\n\n if (property.defaultValue !== undefined) {\n meta.push(`default \\`${docsDefaultValue(property.defaultValue)}\\``);\n }\n\n if (property.constructOnly) {\n meta.push(\"construct-only\");\n }\n\n if (!isConstructableProperty(property)) {\n meta.push(`read-only, observe with \\`onNotify${upperFirst(jsName)}\\``);\n }\n\n if (owner.origin !== undefined) {\n meta.push(`from \\`${owner.origin}\\``);\n }\n\n return { name: jsName, meta: meta.join(\" · \"), doc: docMarkdown(property.doc) };\n};\n\nconst propJsName = (property: GirProperty, seen: Set<string>): string | undefined => {\n if (!property.introspectable) {\n return undefined;\n }\n\n const jsName = toCamelIdentifier(property.name);\n\n if (seen.has(jsName)) {\n return undefined;\n }\n\n seen.add(jsName);\n\n return jsName;\n};\n\nconst ownerPropEntries = (context: ElementPageContext, owner: MemberOwner, seen: Set<string>): PropEntry[] => {\n const entries: PropEntry[] = [];\n\n for (const property of owner.klass.properties) {\n const jsName = propJsName(property, seen);\n\n if (jsName !== undefined) {\n entries.push(propertyEntry(context, owner, property, jsName));\n }\n }\n\n return entries;\n};\n\nconst propertyEntries = (entry: GlibNamedClass, context: ElementPageContext, seen: Set<string>): PropEntry[] => {\n const entries: PropEntry[] = [];\n\n for (const owner of memberOwners(entry, context)) {\n entries.push(...ownerPropEntries(context, owner, seen));\n }\n\n return entries;\n};\n\nconst propsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const seen: Set<string> = new Set();\n const entries = propertyEntries(entry, context, seen);\n\n const intro = [\n `\\`ref\\` receives the \\`${selfType}\\` instance.`,\n \"Every mutable property also has an `onNotify<Prop>` handler prop called with the new value \" +\n \"when the property changes.\",\n \"Props inherited from ancestor elements are documented on their own pages.\",\n ].join(\" \");\n\n if (entries.length === 0) {\n return [\"## Props\", intro];\n }\n\n const sorted = sortStringsBy(entries, (item) => item.name);\n\n return [\"## Props\", intro, ...sorted.map((item) => metaBlock(item.name, item.meta, item.doc))];\n};\n\nconst ownerSignalEntries = (\n context: ElementPageContext,\n owner: MemberOwner,\n selfType: string,\n seen: Set<string>,\n): SignalEntry[] => {\n const entries: SignalEntry[] = [];\n\n for (const signal of owner.klass.signals) {\n const name = signalHandlerName(signal.name);\n\n if (seen.has(name)) {\n continue;\n }\n\n seen.add(name);\n\n entries.push({\n name,\n signature: renderDocsSignalSignature(context.library, signal, selfType),\n doc: docMarkdown(signal.doc),\n origin: owner.origin,\n });\n }\n\n return entries;\n};\n\nconst signalsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const seen: Set<string> = new Set();\n const entries: SignalEntry[] = [];\n\n for (const owner of memberOwners(entry, context)) {\n entries.push(...ownerSignalEntries(context, owner, selfType, seen));\n }\n\n if (entries.length === 0) {\n return [];\n }\n\n return [\"## Signals\", ...originSignatureBlocks(entries)];\n};\n\nconst methodsSection = (entry: GlibNamedClass, context: ElementPageContext, selfType: string): string[] => {\n const entries = classMethodEntries(context.library, entry.namespace, entry.klass);\n const importPath = `@gtkx/gi/${namespaceDirectory(entry.namespace)}`;\n\n const intro =\n `Methods are called on the \\`${selfType}\\` instance, obtained with the \\`ref\\` prop or ` +\n `imported from \\`${importPath}\\`. Methods inherited from ancestors are documented on their own pages.`;\n\n return methodsSectionBlocks(entries, intro);\n};\n\nconst renderElementPage = (entry: GlibNamedClass, context: ElementPageContext): string => {\n const selfType = `${entry.namespace.name}.${entry.klass.name}`;\n\n return joinSections([\n frontmatter(entry),\n `# ${entry.glibName}`,\n docMarkdown(entry.klass.doc),\n importBlock(entry),\n ...hierarchySection(entry, context),\n ...propsSection(entry, context, selfType),\n ...signalsSection(entry, context, selfType),\n ...methodsSection(entry, context, selfType),\n ]);\n};\n\nexport { createElementPageContext, renderElementPage, type ElementPageContext };\n"]}
|
package/dist/docs/pipeline.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type ElementProps } from "../store/jsx/element-prop-imports.js";
|
|
2
|
+
type DocsElementLink = {
|
|
3
3
|
text: string;
|
|
4
4
|
link: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type DocsNamespace = {
|
|
7
7
|
name: string;
|
|
8
8
|
directory: string;
|
|
9
9
|
link: string;
|
|
10
10
|
elements: DocsElementLink[];
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type DocsOptions = {
|
|
13
13
|
libraries: string[];
|
|
14
14
|
girPath: string[];
|
|
15
15
|
outDir: string;
|
|
16
16
|
basePath?: string;
|
|
17
|
-
|
|
17
|
+
props?: ElementProps;
|
|
18
18
|
force?: boolean;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type DocsResult = {
|
|
21
21
|
regenerated: boolean;
|
|
22
22
|
namespaces: DocsNamespace[];
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
declare const writeDocs: (options: DocsOptions) => DocsResult;
|
|
25
|
+
export { writeDocs, type DocsElementLink, type DocsNamespace, type DocsOptions, type DocsResult };
|
|
25
26
|
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/docs/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/docs/pipeline.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,sCAAsC,CAAC;AAK1F,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAEF,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAcF,KAAK,UAAU,GAAG;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,aAAa,EAAE,CAAC;CAC/B,CAAC;AAuKF,QAAA,MAAM,SAAS,GAAI,SAAS,WAAW,KAAG,UAwBzC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
package/dist/docs/pipeline.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
+
import { sortStringsBy } from "@gtkx/utils";
|
|
1
2
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
3
|
import { dirname, join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { computeFingerprint, FINGERPRINT_FILENAME, isStoreFresh } from "../fingerprint.js";
|
|
4
|
+
import { computeGiFingerprint, FINGERPRINT_FILENAME, isGiStoreFresh } from "../fingerprint.js";
|
|
5
5
|
import { Library } from "../gir/library.js";
|
|
6
6
|
import { namespaceDirectory } from "../gir/namespace.js";
|
|
7
|
-
import {
|
|
7
|
+
import { setElementProps } from "../store/jsx/element-prop-imports.js";
|
|
8
|
+
import { collectIntrinsicElementClasses } from "../store/jsx/intrinsic-elements.js";
|
|
8
9
|
import { createElementPageContext, renderElementPage } from "./element-page.js";
|
|
9
10
|
import { elementSlug, firstSentence, namespaceOrder } from "./render.js";
|
|
10
11
|
const MANIFEST_FILENAME = "manifest.json";
|
|
11
12
|
const namespaceIndexPage = (namespace, elements) => {
|
|
12
13
|
const rows = elements.map((entry, index) => {
|
|
13
14
|
const link = namespace.elements[index]?.link ?? "";
|
|
14
|
-
const description = firstSentence(entry.klass.doc).replaceAll("|",
|
|
15
|
+
const description = firstSentence(entry.klass.doc).replaceAll("|", String.raw `\|`);
|
|
15
16
|
return `| [${entry.glibName}](${link}) | ${description} |`;
|
|
16
17
|
});
|
|
18
|
+
const description = `Reference pages for the ${String(namespace.elements.length)} JSX elements in ` +
|
|
19
|
+
`the ${namespace.name} namespace.`;
|
|
17
20
|
return [
|
|
18
21
|
"---",
|
|
19
|
-
`description: ${JSON.stringify(
|
|
22
|
+
`description: ${JSON.stringify(description)}`,
|
|
20
23
|
"---",
|
|
21
24
|
"",
|
|
22
25
|
`# ${namespace.name} elements`,
|
|
23
26
|
"",
|
|
24
|
-
`Elements in this namespace are imported from \`@gtkx/jsx/${namespace.directory}\`; the matching
|
|
27
|
+
`Elements in this namespace are imported from \`@gtkx/jsx/${namespace.directory}\`; the matching ` +
|
|
28
|
+
`classes, enums, and functions are imported from \`@gtkx/gi/${namespace.directory}\`.`,
|
|
25
29
|
"",
|
|
26
30
|
"| Element | Description |",
|
|
27
31
|
"| --- | --- |",
|
|
@@ -30,20 +34,24 @@ const namespaceIndexPage = (namespace, elements) => {
|
|
|
30
34
|
].join("\n");
|
|
31
35
|
};
|
|
32
36
|
const rootIndexPage = (namespaces, libraries) => {
|
|
33
|
-
const rows = namespaces.map((ns) => `| [${ns.name}](${ns.link}) | \`@gtkx/jsx/${ns.directory}\` | ${ns.elements.length} |`);
|
|
37
|
+
const rows = namespaces.map((ns) => `| [${ns.name}](${ns.link}) | \`@gtkx/jsx/${ns.directory}\` | ${String(ns.elements.length)} |`);
|
|
34
38
|
const librariesList = libraries.map((library) => `\`${library}\``).join(", ");
|
|
35
39
|
return [
|
|
36
40
|
"---",
|
|
37
|
-
|
|
41
|
+
"description: \"Generated reference documentation for every JSX element in this project's GIR libraries.\"",
|
|
38
42
|
"---",
|
|
39
43
|
"",
|
|
40
44
|
"# Element Reference",
|
|
41
45
|
"",
|
|
42
|
-
|
|
46
|
+
"This reference documents every JSX element generated from the GObject-Introspection data for " +
|
|
47
|
+
`${librariesList}, together with the namespaces they pull in. It is produced by \`gtkx docs\` ` +
|
|
48
|
+
"using the same pipeline that generates the `@gtkx/jsx` and `@gtkx/gi` bindings, so every page " +
|
|
49
|
+
"matches the types your editor sees.",
|
|
43
50
|
"",
|
|
44
51
|
"Each element page lists:",
|
|
45
52
|
"",
|
|
46
|
-
"- **Props** derived from GObject properties, plus the element props GTKX adds (such as `children`
|
|
53
|
+
"- **Props** derived from GObject properties, plus the element props GTKX adds (such as `children` " +
|
|
54
|
+
"and named slots), with types, defaults, and upstream documentation.",
|
|
47
55
|
"- **Signals** as `on<Signal>` handler props with their exact handler signatures.",
|
|
48
56
|
"- **Methods** available on the underlying instance through the `ref` prop.",
|
|
49
57
|
"",
|
|
@@ -55,76 +63,94 @@ const rootIndexPage = (namespaces, libraries) => {
|
|
|
55
63
|
"",
|
|
56
64
|
].join("\n");
|
|
57
65
|
};
|
|
58
|
-
const
|
|
59
|
-
const intrinsicElements = collectIntrinsicElementClasses(library);
|
|
66
|
+
const groupElementsByNamespace = (elements) => {
|
|
60
67
|
const byNamespace = new Map();
|
|
61
|
-
for (const entry of
|
|
68
|
+
for (const entry of elements) {
|
|
62
69
|
const list = byNamespace.get(entry.namespace.name) ?? [];
|
|
63
70
|
list.push(entry);
|
|
64
71
|
byNamespace.set(entry.namespace.name, list);
|
|
65
72
|
}
|
|
73
|
+
return byNamespace;
|
|
74
|
+
};
|
|
75
|
+
const buildElementLinks = (elements, basePath) => {
|
|
66
76
|
const linkByGlibName = new Map();
|
|
67
|
-
for (const entry of
|
|
77
|
+
for (const entry of elements) {
|
|
68
78
|
const directory = namespaceDirectory(entry.namespace);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const existing = [...linkByGlibName.values()].includes(link);
|
|
72
|
-
if (existing)
|
|
79
|
+
const link = `${basePath}/${directory}/${elementSlug(entry.klass.name)}`;
|
|
80
|
+
if (linkByGlibName.values().some((existing) => existing === link)) {
|
|
73
81
|
throw new Error(`Docs page slug collision for ${entry.glibName} at ${link}`);
|
|
82
|
+
}
|
|
74
83
|
linkByGlibName.set(entry.glibName, link);
|
|
75
84
|
}
|
|
76
|
-
|
|
85
|
+
return linkByGlibName;
|
|
86
|
+
};
|
|
87
|
+
const namespacePages = (input) => {
|
|
88
|
+
const { name, elements, basePath, linkByGlibName, pageContext } = input;
|
|
89
|
+
const directory = name.toLowerCase();
|
|
90
|
+
const docs = {
|
|
91
|
+
name,
|
|
92
|
+
directory,
|
|
93
|
+
link: `${basePath}/${directory}/`,
|
|
94
|
+
elements: elements.map((entry) => ({ text: entry.glibName, link: linkByGlibName.get(entry.glibName) ?? "" })),
|
|
95
|
+
};
|
|
96
|
+
const pages = elements.map((entry) => ({
|
|
97
|
+
path: `${directory}/${elementSlug(entry.klass.name)}.md`,
|
|
98
|
+
content: renderElementPage(entry, pageContext),
|
|
99
|
+
}));
|
|
100
|
+
pages.push({ path: `${directory}/index.md`, content: namespaceIndexPage(docs, elements) });
|
|
101
|
+
return { docs, pages };
|
|
102
|
+
};
|
|
103
|
+
const generatePages = (options, basePath, library) => {
|
|
104
|
+
const intrinsicElements = collectIntrinsicElementClasses(library);
|
|
105
|
+
const byNamespace = groupElementsByNamespace(intrinsicElements);
|
|
106
|
+
const linkByGlibName = buildElementLinks(intrinsicElements, basePath);
|
|
107
|
+
const pageContext = createElementPageContext(library, (glibName) => linkByGlibName.get(glibName));
|
|
77
108
|
const pages = [];
|
|
78
109
|
const namespaces = [];
|
|
79
|
-
const orderedNames = sortStringsBy(
|
|
110
|
+
const orderedNames = sortStringsBy(byNamespace.keys(), namespaceOrder);
|
|
80
111
|
for (const name of orderedNames) {
|
|
81
112
|
const elements = sortStringsBy(byNamespace.get(name) ?? [], (entry) => entry.glibName);
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
directory,
|
|
86
|
-
link: `${basePath}/${directory}/`,
|
|
87
|
-
elements: elements.map((entry) => ({
|
|
88
|
-
text: entry.glibName,
|
|
89
|
-
link: linkByGlibName.get(entry.glibName) ?? "",
|
|
90
|
-
})),
|
|
91
|
-
};
|
|
92
|
-
for (const entry of elements) {
|
|
93
|
-
const slug = elementSlug(entry.klass.name);
|
|
94
|
-
pages.push({ path: `${directory}/${slug}.md`, content: renderElementPage(entry, pageContext) });
|
|
95
|
-
}
|
|
96
|
-
pages.push({ path: `${directory}/index.md`, content: namespaceIndexPage(namespaceDocs, elements) });
|
|
97
|
-
namespaces.push(namespaceDocs);
|
|
113
|
+
const result = namespacePages({ name, elements, basePath, linkByGlibName, pageContext });
|
|
114
|
+
pages.push(...result.pages);
|
|
115
|
+
namespaces.push(result.docs);
|
|
98
116
|
}
|
|
99
117
|
pages.push({ path: "index.md", content: rootIndexPage(namespaces, options.libraries) });
|
|
100
118
|
return { pages, namespaces };
|
|
101
119
|
};
|
|
102
|
-
|
|
120
|
+
const cachedDocsResult = (options, manifestPath) => {
|
|
121
|
+
if (options.force === true || !isGiStoreFresh(options.outDir, options.libraries, options.girPath)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
if (!existsSync(manifestPath)) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
128
|
+
return { regenerated: false, namespaces: manifest.namespaces };
|
|
129
|
+
};
|
|
130
|
+
const writePages = (outDir, pages) => {
|
|
131
|
+
for (const page of pages) {
|
|
132
|
+
const target = join(outDir, page.path);
|
|
133
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
134
|
+
writeFileSync(target, page.content);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const writeDocs = (options) => {
|
|
138
|
+
setElementProps(options.props ?? {});
|
|
103
139
|
const basePath = options.basePath ?? "/reference";
|
|
104
|
-
const elementProps = options.elementProps ?? {};
|
|
105
140
|
const manifestPath = join(options.outDir, MANIFEST_FILENAME);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return { regenerated: false, namespaces: manifest.namespaces };
|
|
110
|
-
}
|
|
141
|
+
const cached = cachedDocsResult(options, manifestPath);
|
|
142
|
+
if (cached !== undefined) {
|
|
143
|
+
return cached;
|
|
111
144
|
}
|
|
112
145
|
const library = Library.load(options.libraries, options.girPath);
|
|
113
146
|
const { pages, namespaces } = generatePages(options, basePath, library);
|
|
114
147
|
rmSync(options.outDir, { recursive: true, force: true });
|
|
115
148
|
mkdirSync(options.outDir, { recursive: true });
|
|
116
|
-
|
|
117
|
-
const target = join(options.outDir, page.path);
|
|
118
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
119
|
-
writeFileSync(target, page.content);
|
|
120
|
-
}
|
|
149
|
+
writePages(options.outDir, pages);
|
|
121
150
|
const manifest = { namespaces };
|
|
122
151
|
writeFileSync(manifestPath, JSON.stringify(manifest));
|
|
123
|
-
writeFileSync(join(options.outDir, FINGERPRINT_FILENAME), JSON.stringify(
|
|
124
|
-
value: computeFingerprint(library.girFiles, options.libraries, elementProps),
|
|
125
|
-
girFiles: library.girFiles,
|
|
126
|
-
libraries: options.libraries,
|
|
127
|
-
}));
|
|
152
|
+
writeFileSync(join(options.outDir, FINGERPRINT_FILENAME), JSON.stringify(computeGiFingerprint(library.girFiles, options.libraries, options.girPath)));
|
|
128
153
|
return { regenerated: true, namespaces };
|
|
129
154
|
};
|
|
155
|
+
export { writeDocs };
|
|
130
156
|
//# sourceMappingURL=pipeline.js.map
|