@cratis/scene.model 4.23.0 → 4.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/descriptors/ComponentCategory.ts +40 -0
  2. package/descriptors/ComponentDescriptor.ts +22 -1
  3. package/descriptors/ComponentDesignModeDescriptor.ts +76 -0
  4. package/descriptors/PropertyDescriptor.ts +5 -1
  5. package/descriptors/PropertyEditorKind.ts +56 -1
  6. package/descriptors/PropertyEditorOptions.ts +51 -0
  7. package/descriptors/componentIcon.ts +16 -0
  8. package/descriptors/index.ts +4 -0
  9. package/dist/cjs/descriptors/ComponentCategory.js +25 -0
  10. package/dist/cjs/descriptors/ComponentCategory.js.map +1 -0
  11. package/dist/cjs/descriptors/ComponentDescriptor.js +5 -0
  12. package/dist/cjs/descriptors/ComponentDescriptor.js.map +1 -1
  13. package/dist/cjs/descriptors/ComponentDesignModeDescriptor.js +28 -0
  14. package/dist/cjs/descriptors/ComponentDesignModeDescriptor.js.map +1 -0
  15. package/dist/cjs/descriptors/PropertyDescriptor.js +1 -0
  16. package/dist/cjs/descriptors/PropertyDescriptor.js.map +1 -1
  17. package/dist/cjs/descriptors/PropertyEditorKind.js +23 -2
  18. package/dist/cjs/descriptors/PropertyEditorKind.js.map +1 -1
  19. package/dist/cjs/descriptors/PropertyEditorOptions.js +25 -0
  20. package/dist/cjs/descriptors/PropertyEditorOptions.js.map +1 -0
  21. package/dist/cjs/descriptors/componentIcon.js +19 -0
  22. package/dist/cjs/descriptors/componentIcon.js.map +1 -0
  23. package/dist/cjs/editing/DiagnosticCode.js +5 -0
  24. package/dist/cjs/editing/DiagnosticCode.js.map +1 -1
  25. package/dist/cjs/index.js +16 -0
  26. package/dist/cjs/index.js.map +1 -1
  27. package/dist/cjs/screens/TemplateMetadata.js +2 -1
  28. package/dist/cjs/screens/TemplateMetadata.js.map +1 -1
  29. package/dist/cjs/screens/TemplateReference.js +19 -0
  30. package/dist/cjs/screens/TemplateReference.js.map +1 -0
  31. package/dist/esm/descriptors/ComponentCategory.d.ts +13 -0
  32. package/dist/esm/descriptors/ComponentCategory.d.ts.map +1 -0
  33. package/dist/esm/descriptors/ComponentCategory.js +22 -0
  34. package/dist/esm/descriptors/ComponentCategory.js.map +1 -0
  35. package/dist/esm/descriptors/ComponentDescriptor.d.ts +7 -0
  36. package/dist/esm/descriptors/ComponentDescriptor.d.ts.map +1 -1
  37. package/dist/esm/descriptors/ComponentDescriptor.js +5 -0
  38. package/dist/esm/descriptors/ComponentDescriptor.js.map +1 -1
  39. package/dist/esm/descriptors/ComponentDesignModeDescriptor.d.ts +24 -0
  40. package/dist/esm/descriptors/ComponentDesignModeDescriptor.d.ts.map +1 -0
  41. package/dist/esm/descriptors/ComponentDesignModeDescriptor.js +24 -0
  42. package/dist/esm/descriptors/ComponentDesignModeDescriptor.js.map +1 -0
  43. package/dist/esm/descriptors/PropertyDescriptor.d.ts +2 -0
  44. package/dist/esm/descriptors/PropertyDescriptor.d.ts.map +1 -1
  45. package/dist/esm/descriptors/PropertyDescriptor.js +1 -0
  46. package/dist/esm/descriptors/PropertyDescriptor.js.map +1 -1
  47. package/dist/esm/descriptors/PropertyEditorKind.d.ts +17 -0
  48. package/dist/esm/descriptors/PropertyEditorKind.d.ts.map +1 -1
  49. package/dist/esm/descriptors/PropertyEditorKind.js +23 -2
  50. package/dist/esm/descriptors/PropertyEditorKind.js.map +1 -1
  51. package/dist/esm/descriptors/PropertyEditorOptions.d.ts +18 -0
  52. package/dist/esm/descriptors/PropertyEditorOptions.d.ts.map +1 -0
  53. package/dist/esm/descriptors/PropertyEditorOptions.js +22 -0
  54. package/dist/esm/descriptors/PropertyEditorOptions.js.map +1 -0
  55. package/dist/esm/descriptors/componentIcon.d.ts +4 -0
  56. package/dist/esm/descriptors/componentIcon.d.ts.map +1 -0
  57. package/dist/esm/descriptors/componentIcon.js +16 -0
  58. package/dist/esm/descriptors/componentIcon.js.map +1 -0
  59. package/dist/esm/descriptors/index.d.ts +4 -0
  60. package/dist/esm/descriptors/index.d.ts.map +1 -1
  61. package/dist/esm/descriptors/index.js +4 -0
  62. package/dist/esm/descriptors/index.js.map +1 -1
  63. package/dist/esm/editing/DiagnosticCode.d.ts +5 -1
  64. package/dist/esm/editing/DiagnosticCode.d.ts.map +1 -1
  65. package/dist/esm/editing/DiagnosticCode.js +5 -0
  66. package/dist/esm/editing/DiagnosticCode.js.map +1 -1
  67. package/dist/esm/index.js +5 -0
  68. package/dist/esm/index.js.map +1 -1
  69. package/dist/esm/screens/TemplateMetadata.d.ts +2 -0
  70. package/dist/esm/screens/TemplateMetadata.d.ts.map +1 -1
  71. package/dist/esm/screens/TemplateMetadata.js +2 -1
  72. package/dist/esm/screens/TemplateMetadata.js.map +1 -1
  73. package/dist/esm/screens/TemplateReference.d.ts +12 -0
  74. package/dist/esm/screens/TemplateReference.d.ts.map +1 -0
  75. package/dist/esm/screens/TemplateReference.js +16 -0
  76. package/dist/esm/screens/TemplateReference.js.map +1 -0
  77. package/dist/esm/screens/index.d.ts +1 -0
  78. package/dist/esm/screens/index.d.ts.map +1 -1
  79. package/dist/esm/screens/index.js +1 -0
  80. package/dist/esm/screens/index.js.map +1 -1
  81. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  82. package/editing/DiagnosticCode.ts +6 -0
  83. package/package.json +1 -1
  84. package/screens/TemplateMetadata.ts +9 -2
  85. package/screens/TemplateReference.ts +30 -0
  86. package/screens/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"DiagnosticCode.js","sources":["../../../editing/DiagnosticCode.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The reasons inspection, editing, binding validation and configuration resolution report a problem. A host\n * switches on the code; the message is for a person.\n */\nexport enum DiagnosticCode {\n // Addressing\n UnknownNode = 'unknownNode',\n DuplicateElementId = 'duplicateElementId',\n UnknownScope = 'unknownScope',\n InvalidEdit = 'invalidEdit',\n\n // Properties\n UnknownProperty = 'unknownProperty',\n InvalidValue = 'invalidValue',\n ReadOnlyProperty = 'readOnlyProperty',\n NodeNotEditable = 'nodeNotEditable',\n MissingComponentDescriptor = 'missingComponentDescriptor',\n\n // Layout\n NotALayoutNode = 'notALayoutNode',\n LayoutTypeNotConvertible = 'layoutTypeNotConvertible',\n LossyConversionNotAccepted = 'lossyConversionNotAccepted',\n LossyConversion = 'lossyConversion',\n\n // Structure\n TargetDoesNotAcceptChildren = 'targetDoesNotAcceptChildren',\n UnknownSlot = 'unknownSlot',\n ContainmentCycle = 'containmentCycle',\n IndexOutOfRange = 'indexOutOfRange',\n ElementIdInUse = 'elementIdInUse',\n MaximumChildrenExceeded = 'maximumChildrenExceeded',\n NodeNotRemovable = 'nodeNotRemovable',\n\n // Query binding\n MissingQuery = 'missingQuery',\n IncompatibleResultShape = 'incompatibleResultShape',\n MissingRequiredParameter = 'missingRequiredParameter',\n UnknownParameter = 'unknownParameter',\n ArgumentTypeMismatch = 'argumentTypeMismatch',\n UnresolvedArgumentSource = 'unresolvedArgumentSource',\n UnknownResultField = 'unknownResultField',\n\n // Exposure and instance configuration\n ExposureTargetMissing = 'exposureTargetMissing',\n ExposureWidensOwner = 'exposureWidensOwner',\n ReExposureBroken = 'reExposureBroken',\n ContributionNotExposed = 'contributionNotExposed',\n ContributionTargetMissing = 'contributionTargetMissing',\n ContributionTypeMismatch = 'contributionTypeMismatch',\n ContributionOperationNotPermitted = 'contributionOperationNotPermitted',\n UnknownCollectionField = 'unknownCollectionField',\n CollectionItemNotFound = 'collectionItemNotFound',\n DuplicateCollectionItem = 'duplicateCollectionItem',\n UnknownInstance = 'unknownInstance',\n\n // Icons\n MissingIconLibrary = 'missingIconLibrary',\n MissingIcon = 'missingIcon',\n MissingIconVariant = 'missingIconVariant',\n IncompatibleIconLibrary = 'incompatibleIconLibrary',\n IconCatalogUnavailable = 'iconCatalogUnavailable',\n IconNotVerified = 'iconNotVerified',\n}\n"],"names":["DiagnosticCode"],"mappings":";;AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AA0DX,CAAA,CAAA,EAAA;;"}
1
+ {"version":3,"file":"DiagnosticCode.js","sources":["../../../editing/DiagnosticCode.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The reasons inspection, editing, binding validation and configuration resolution report a problem. A host\n * switches on the code; the message is for a person.\n */\nexport enum DiagnosticCode {\n // Addressing\n UnknownNode = 'unknownNode',\n DuplicateElementId = 'duplicateElementId',\n UnknownScope = 'unknownScope',\n InvalidEdit = 'invalidEdit',\n\n // Properties\n UnknownProperty = 'unknownProperty',\n InvalidValue = 'invalidValue',\n ReadOnlyProperty = 'readOnlyProperty',\n NodeNotEditable = 'nodeNotEditable',\n MissingComponentDescriptor = 'missingComponentDescriptor',\n\n // Layout\n NotALayoutNode = 'notALayoutNode',\n LayoutTypeNotConvertible = 'layoutTypeNotConvertible',\n LossyConversionNotAccepted = 'lossyConversionNotAccepted',\n LossyConversion = 'lossyConversion',\n\n // Structure\n TargetDoesNotAcceptChildren = 'targetDoesNotAcceptChildren',\n UnknownSlot = 'unknownSlot',\n ContainmentCycle = 'containmentCycle',\n IndexOutOfRange = 'indexOutOfRange',\n ElementIdInUse = 'elementIdInUse',\n MaximumChildrenExceeded = 'maximumChildrenExceeded',\n NodeNotRemovable = 'nodeNotRemovable',\n\n // Query binding\n MissingQuery = 'missingQuery',\n IncompatibleResultShape = 'incompatibleResultShape',\n MissingRequiredParameter = 'missingRequiredParameter',\n UnknownParameter = 'unknownParameter',\n ArgumentTypeMismatch = 'argumentTypeMismatch',\n UnresolvedArgumentSource = 'unresolvedArgumentSource',\n UnknownResultField = 'unknownResultField',\n\n // Exposure and instance configuration\n ExposureTargetMissing = 'exposureTargetMissing',\n ExposureWidensOwner = 'exposureWidensOwner',\n ReExposureBroken = 'reExposureBroken',\n ContributionNotExposed = 'contributionNotExposed',\n ContributionTargetMissing = 'contributionTargetMissing',\n ContributionTypeMismatch = 'contributionTypeMismatch',\n ContributionOperationNotPermitted = 'contributionOperationNotPermitted',\n UnknownCollectionField = 'unknownCollectionField',\n CollectionItemNotFound = 'collectionItemNotFound',\n DuplicateCollectionItem = 'duplicateCollectionItem',\n UnknownInstance = 'unknownInstance',\n\n // Icons\n MissingIconLibrary = 'missingIconLibrary',\n MissingIcon = 'missingIcon',\n MissingIconVariant = 'missingIconVariant',\n IncompatibleIconLibrary = 'incompatibleIconLibrary',\n IconCatalogUnavailable = 'iconCatalogUnavailable',\n IconNotVerified = 'iconNotVerified',\n\n // Component metadata\n ComponentCategoryMissing = 'componentCategoryMissing',\n ComponentCategoryUnknown = 'componentCategoryUnknown',\n ComponentDesignModeInvalid = 'componentDesignModeInvalid',\n PropertyEditorOptionsInvalid = 'propertyEditorOptionsInvalid',\n}\n"],"names":["DiagnosticCode"],"mappings":";;AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AAgEX,CAAA,CAAA,EAAA;;"}
package/dist/cjs/index.js CHANGED
@@ -104,6 +104,7 @@ var DialogTemplate = require('./screens/DialogTemplate.js');
104
104
  var TemplateAttribution = require('./screens/TemplateAttribution.js');
105
105
  var TemplateCompatibility = require('./screens/TemplateCompatibility.js');
106
106
  var TemplateMetadata = require('./screens/TemplateMetadata.js');
107
+ var TemplateReference = require('./screens/TemplateReference.js');
107
108
  var UiStarter = require('./starters/UiStarter.js');
108
109
  var QueryResultShape = require('./queries/QueryResultShape.js');
109
110
  var QueryOriginKind = require('./queries/QueryOriginKind.js');
@@ -116,6 +117,7 @@ var QueryResultBinding = require('./queries/QueryResultBinding.js');
116
117
  var QueryBinding = require('./queries/QueryBinding.js');
117
118
  var PropertyValueType = require('./descriptors/PropertyValueType.js');
118
119
  var PropertyEditorKind = require('./descriptors/PropertyEditorKind.js');
120
+ var PropertyEditorOptions = require('./descriptors/PropertyEditorOptions.js');
119
121
  var PropertyChoice = require('./descriptors/PropertyChoice.js');
120
122
  var PropertyConstraints = require('./descriptors/PropertyConstraints.js');
121
123
  var CollectionItemDescriptor = require('./descriptors/CollectionItemDescriptor.js');
@@ -123,6 +125,9 @@ var DesignTimeActionDescriptor = require('./descriptors/DesignTimeActionDescript
123
125
  var DesignTimeActionPlacement = require('./descriptors/DesignTimeActionPlacement.js');
124
126
  var PackageDesignTimeMetadata = require('./descriptors/PackageDesignTimeMetadata.js');
125
127
  var PropertyDescriptor = require('./descriptors/PropertyDescriptor.js');
128
+ var ComponentCategory = require('./descriptors/ComponentCategory.js');
129
+ var ComponentDesignModeDescriptor = require('./descriptors/ComponentDesignModeDescriptor.js');
130
+ var componentIcon = require('./descriptors/componentIcon.js');
126
131
  var ComponentDescriptor = require('./descriptors/ComponentDescriptor.js');
127
132
  var CollectionOperation = require('./descriptors/CollectionOperation.js');
128
133
  var LayoutType = require('./descriptors/LayoutType.js');
@@ -282,6 +287,8 @@ exports.TemplateAttributionPropertyNames = TemplateAttribution.TemplateAttributi
282
287
  exports.TemplateCompatibilityPropertyNames = TemplateCompatibility.TemplateCompatibilityPropertyNames;
283
288
  exports.TemplateMetadataPropertyNames = TemplateMetadata.TemplateMetadataPropertyNames;
284
289
  exports.TemplateScope = TemplateMetadata.TemplateScope;
290
+ exports.TemplateReferencePropertyNames = TemplateReference.TemplateReferencePropertyNames;
291
+ exports.TemplateReferenceSource = TemplateReference.TemplateReferenceSource;
285
292
  exports.UiStarterPropertyNames = UiStarter.UiStarterPropertyNames;
286
293
  exports.QueryResultShape = QueryResultShape.QueryResultShape;
287
294
  exports.QueryOriginKind = QueryOriginKind.QueryOriginKind;
@@ -294,6 +301,8 @@ exports.QueryResultBindingPropertyNames = QueryResultBinding.QueryResultBindingP
294
301
  exports.QueryBindingPropertyNames = QueryBinding.QueryBindingPropertyNames;
295
302
  exports.PropertyValueType = PropertyValueType.PropertyValueType;
296
303
  exports.PropertyEditorKind = PropertyEditorKind.PropertyEditorKind;
304
+ exports.PropertyEditorOptionsPropertyNames = PropertyEditorOptions.PropertyEditorOptionsPropertyNames;
305
+ exports.ReferenceFilterDescriptorPropertyNames = PropertyEditorOptions.ReferenceFilterDescriptorPropertyNames;
297
306
  exports.PropertyChoicePropertyNames = PropertyChoice.PropertyChoicePropertyNames;
298
307
  exports.PropertyConstraintsPropertyNames = PropertyConstraints.PropertyConstraintsPropertyNames;
299
308
  exports.CollectionItemDescriptorPropertyNames = CollectionItemDescriptor.CollectionItemDescriptorPropertyNames;
@@ -301,6 +310,13 @@ exports.DesignTimeActionDescriptorPropertyNames = DesignTimeActionDescriptor.Des
301
310
  exports.DesignTimeActionPlacement = DesignTimeActionPlacement.DesignTimeActionPlacement;
302
311
  exports.PackageDesignTimeMetadataPropertyNames = PackageDesignTimeMetadata.PackageDesignTimeMetadataPropertyNames;
303
312
  exports.PropertyDescriptorPropertyNames = PropertyDescriptor.PropertyDescriptorPropertyNames;
313
+ exports.ComponentCategory = ComponentCategory.ComponentCategory;
314
+ exports.componentCategories = ComponentCategory.componentCategories;
315
+ exports.ComponentDesignModeDescriptorPropertyNames = ComponentDesignModeDescriptor.ComponentDesignModeDescriptorPropertyNames;
316
+ exports.DesignModeAddActionPropertyNames = ComponentDesignModeDescriptor.DesignModeAddActionPropertyNames;
317
+ exports.DesignModeItemActionPropertyNames = ComponentDesignModeDescriptor.DesignModeItemActionPropertyNames;
318
+ exports.componentIcon = componentIcon.componentIcon;
319
+ exports.componentIconLibrary = componentIcon.componentIconLibrary;
304
320
  exports.ComponentDescriptorPropertyNames = ComponentDescriptor.ComponentDescriptorPropertyNames;
305
321
  exports.CollectionOperation = CollectionOperation.CollectionOperation;
306
322
  exports.LayoutType = LayoutType.LayoutType;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,7 +17,8 @@ const TemplateMetadataPropertyNames = [
17
17
  'compatibility',
18
18
  'attribution',
19
19
  'license',
20
- 'licenseUrl'
20
+ 'licenseUrl',
21
+ 'sliceKinds'
21
22
  ];
22
23
 
23
24
  exports.TemplateMetadataPropertyNames = TemplateMetadataPropertyNames;
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateMetadata.js","sources":["../../../screens/TemplateMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateAttribution } from './TemplateAttribution';\nimport { TemplateCompatibility } from './TemplateCompatibility';\n\n/** The application hierarchy at which a reusable template is selected. */\nexport enum TemplateScope {\n Application = 'Application',\n Module = 'Module',\n Feature = 'Feature',\n Subfeature = 'Subfeature',\n Slice = 'Slice',\n}\n\n/**\n * Optional semantic and browsing metadata. Type and category are open strings so packages can\n * introduce their own vocabulary without a Scene release. Category never determines applicability.\n */\nexport interface TemplateMetadata {\n /** Semantic role; built-in roles are ApplicationShell, Workspace, List, Detail, Form and Dialog. */\n type?: string;\n /** A package-defined browse category, preserved even when the host does not recognize it. */\n category?: string;\n /** Explicit scope restriction. Absent uses the structural role; an empty list allows no scope. */\n scopes?: TemplateScope[];\n /** The Scene and package versions the template requires. Required for every shipped template. */\n compatibility?: TemplateCompatibility;\n /** Who authored the template. Required for every shipped template. */\n attribution?: TemplateAttribution;\n /** The SPDX license identifier the template is available under, such as `MIT`. Required for every shipped template. */\n license?: string;\n /** An absolute `https` URL to the license terms. */\n licenseUrl?: string;\n}\n\nexport const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [\n 'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl',\n];\n"],"names":["TemplateScope","TemplateMetadataPropertyNames"],"mappings":";;AAAA;AACA;AAKA,2EACO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;;;;;;AAAAA,IAAAA,OAAAA,aAAAA;AAMX,CAAA,CAAA,EAAA;MAuBYC,6BAAAA,GAA4D;AACrE,IAAA,MAAA;AAAQ,IAAA,UAAA;AAAY,IAAA,QAAA;AAAU,IAAA,eAAA;AAAiB,IAAA,aAAA;AAAe,IAAA,SAAA;AAAW,IAAA;;;;"}
1
+ {"version":3,"file":"TemplateMetadata.js","sources":["../../../screens/TemplateMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateAttribution } from './TemplateAttribution';\nimport { TemplateCompatibility } from './TemplateCompatibility';\nimport { SliceKind } from '../structure';\n\n/** The application hierarchy at which a reusable template is selected. */\nexport enum TemplateScope {\n Application = 'Application',\n Module = 'Module',\n Feature = 'Feature',\n Subfeature = 'Subfeature',\n Slice = 'Slice',\n}\n\n/**\n * Semantic and browsing metadata. Category is required for blueprint templates and recommended for own templates. Type and category are open strings so packages can\n * introduce their own vocabulary without a Scene release. Category never determines applicability.\n */\nexport interface TemplateMetadata {\n /** Semantic role; built-in roles are ApplicationShell, Workspace, List, Detail, Form and Dialog. */\n type?: string;\n /** A package-defined browse category, preserved even when the host does not recognize it. */\n category?: string;\n /** Explicit scope restriction. Absent uses the structural role; an empty list allows no scope. */\n scopes?: TemplateScope[];\n /** The Scene and package versions the template requires. Required for every shipped template. */\n compatibility?: TemplateCompatibility;\n /** Who authored the template. Required for every shipped template. */\n attribution?: TemplateAttribution;\n /** The SPDX license identifier the template is available under, such as `MIT`. Required for every shipped template. */\n license?: string;\n /** An absolute `https` URL to the license terms. */\n licenseUrl?: string;\n /**\n * For a template that applies at {@link TemplateScope.Slice}, the slice kinds it applies to. Absent uses the\n * structural default: a dialog template applies to state change slices, a screen template to every kind that\n * presents something. Declaring slice kinds without scopes makes the default scope Slice.\n */\n sliceKinds?: SliceKind[];\n}\n\nexport const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [\n 'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl', 'sliceKinds',\n];\n"],"names":["TemplateScope","TemplateMetadataPropertyNames"],"mappings":";;AAAA;AACA;AAMA,2EACO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;;;;;;AAAAA,IAAAA,OAAAA,aAAAA;AAMX,CAAA,CAAA,EAAA;MA6BYC,6BAAAA,GAA4D;AACrE,IAAA,MAAA;AAAQ,IAAA,UAAA;AAAY,IAAA,QAAA;AAAU,IAAA,eAAA;AAAiB,IAAA,aAAA;AAAe,IAAA,SAAA;AAAW,IAAA,YAAA;AAAc,IAAA;;;;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** Where a referenced template comes from. */ var TemplateReferenceSource = /*#__PURE__*/ function(TemplateReferenceSource) {
6
+ /** A template the user created in the workspace. */ TemplateReferenceSource["Own"] = "Own";
7
+ /** A template shipped by a blueprint package, referenced by blueprint name, template name and version range. */ TemplateReferenceSource["Blueprint"] = "Blueprint";
8
+ return TemplateReferenceSource;
9
+ }({});
10
+ const TemplateReferencePropertyNames = [
11
+ 'source',
12
+ 'id',
13
+ 'blueprint',
14
+ 'version'
15
+ ];
16
+
17
+ exports.TemplateReferencePropertyNames = TemplateReferencePropertyNames;
18
+ exports.TemplateReferenceSource = TemplateReferenceSource;
19
+ //# sourceMappingURL=TemplateReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateReference.js","sources":["../../../screens/TemplateReference.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Where a referenced template comes from. */\nexport enum TemplateReferenceSource {\n /** A template the user created in the workspace. */\n Own = 'Own',\n /** A template shipped by a blueprint package, referenced by blueprint name, template name and version range. */\n Blueprint = 'Blueprint',\n}\n\n/**\n * How a module, feature or slice refers to the template it uses: an own template by name, or a blueprint\n * template by blueprint, name and the version range of the blueprint it was chosen from.\n */\nexport interface TemplateReference {\n /** Whether the template is the user's own or comes from a blueprint. */\n source: TemplateReferenceSource;\n /** The template's name - within the workspace for an own template, within the blueprint for a blueprint template. */\n id: string;\n /** The blueprint package name. Present exactly when `source` is {@link TemplateReferenceSource.Blueprint}. */\n blueprint?: string;\n /**\n * The semver range of the blueprint the reference accepts, such as `^1.2.0`. Defaults to the caret range of the\n * installed blueprint version when a reference is created; absent means any version. Only meaningful for a blueprint reference.\n */\n version?: string;\n}\n\nexport const TemplateReferencePropertyNames: (keyof TemplateReference)[] = ['source', 'id', 'blueprint', 'version'];\n"],"names":["TemplateReferenceSource","TemplateReferencePropertyNames"],"mappings":";;AAAA;AACA;AAEA,+CACO,IAAKA,uBAAAA,iBAAAA,SAAAA,uBAAAA,EAAAA;yDAC0C,uBAAA,CAAA,KAAA,CAAA,GAAA,KAAA;qHAE4D,uBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;AAHtGA,IAAAA,OAAAA,uBAAAA;AAKX,CAAA,CAAA,EAAA;MAoBYC,8BAAAA,GAA8D;AAAC,IAAA,QAAA;AAAU,IAAA,IAAA;AAAM,IAAA,WAAA;AAAa,IAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ export declare const ComponentCategory: {
2
+ readonly Navigation: 'Navigation';
3
+ readonly DataDisplay: 'Data display';
4
+ readonly Input: 'Input';
5
+ readonly Actions: 'Actions';
6
+ readonly Layout: 'Layout';
7
+ readonly Feedback: 'Feedback';
8
+ readonly Overlay: 'Overlay';
9
+ readonly Forms: 'Forms';
10
+ };
11
+ export type ComponentCategory = (typeof ComponentCategory)[keyof typeof ComponentCategory];
12
+ export declare const componentCategories: readonly string[];
13
+ //# sourceMappingURL=ComponentCategory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentCategory.d.ts","sourceRoot":"","sources":["../../../descriptors/ComponentCategory.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;aAE1B,UAAU,EAAE,YAAY;aAGxB,WAAW,EAAE,cAAc;aAG3B,KAAK,EAAE,OAAO;aAGd,OAAO,EAAE,SAAS;aAGlB,MAAM,EAAE,QAAQ;aAGhB,QAAQ,EAAE,UAAU;aAGpB,OAAO,EAAE,SAAS;aAGlB,KAAK,EAAE,OAAO;CACR,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAG3F,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAqC,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * The categories a component picker groups components under. Every component declares exactly one (rule CMP1).
5
+ *
6
+ * The set is open: a package may declare a category of its own, which a validation reports as a warning
7
+ * ({@link DiagnosticCode.ComponentCategoryUnknown}) rather than refusing, so a picker shows it as a group of its own.
8
+ * Matching is by the exact words below.
9
+ */ const ComponentCategory = {
10
+ /** Moves the user between places: topbar, sidebar, tabs, breadcrumbs, stepper. */ Navigation: 'Navigation',
11
+ /** Shows data: data table, list, card grid, board, timeline, stat card, chart. */ DataDisplay: 'Data display',
12
+ /** Takes a value from the user: text field, select, date picker, tag input, lookup. */ Input: 'Input',
13
+ /** Starts something: button, toolbar, menu, command bar. */ Actions: 'Actions',
14
+ /** Arranges other components: stack, grid, split pane, card, section. */ Layout: 'Layout',
15
+ /** Tells the user what happened or is happening: alert, toast, empty state, progress. */ Feedback: 'Feedback',
16
+ /** Appears over the page: dialog, side sheet, popover. */ Overlay: 'Overlay',
17
+ /** Collects a command's input: form, wizard, field group. */ Forms: 'Forms'
18
+ };
19
+ /** Every category this model defines, in the order a picker lists them. */ const componentCategories = Object.values(ComponentCategory);
20
+
21
+ export { ComponentCategory, componentCategories };
22
+ //# sourceMappingURL=ComponentCategory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentCategory.js","sources":["../../../descriptors/ComponentCategory.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The categories a component picker groups components under. Every component declares exactly one (rule CMP1).\n *\n * The set is open: a package may declare a category of its own, which a validation reports as a warning\n * ({@link DiagnosticCode.ComponentCategoryUnknown}) rather than refusing, so a picker shows it as a group of its own.\n * Matching is by the exact words below.\n */\nexport const ComponentCategory = {\n /** Moves the user between places: topbar, sidebar, tabs, breadcrumbs, stepper. */\n Navigation: 'Navigation',\n\n /** Shows data: data table, list, card grid, board, timeline, stat card, chart. */\n DataDisplay: 'Data display',\n\n /** Takes a value from the user: text field, select, date picker, tag input, lookup. */\n Input: 'Input',\n\n /** Starts something: button, toolbar, menu, command bar. */\n Actions: 'Actions',\n\n /** Arranges other components: stack, grid, split pane, card, section. */\n Layout: 'Layout',\n\n /** Tells the user what happened or is happening: alert, toast, empty state, progress. */\n Feedback: 'Feedback',\n\n /** Appears over the page: dialog, side sheet, popover. */\n Overlay: 'Overlay',\n\n /** Collects a command's input: form, wizard, field group. */\n Forms: 'Forms',\n} as const;\n\nexport type ComponentCategory = (typeof ComponentCategory)[keyof typeof ComponentCategory];\n\n/** Every category this model defines, in the order a picker lists them. */\nexport const componentCategories: readonly string[] = Object.values(ComponentCategory);\n"],"names":["ComponentCategory","Navigation","DataDisplay","Input","Actions","Layout","Feedback","Overlay","Forms","componentCategories","Object","values"],"mappings":"AAAA;AACA;AAEA;;;;;;UAOaA,iBAAAA,GAAoB;AAC7B,uFACAC,UAAAA,EAAY,YAAA;AAEZ,uFACAC,WAAAA,EAAa,cAAA;AAEb,4FACAC,KAAAA,EAAO,OAAA;AAEP,iEACAC,OAAAA,EAAS,SAAA;AAET,8EACAC,MAAAA,EAAQ,QAAA;AAER,8FACAC,QAAAA,EAAU,UAAA;AAEV,+DACAC,OAAAA,EAAS,SAAA;AAET,kEACAC,KAAAA,EAAO;AACX;AAIA,4EACO,MAAMC,sBAAyCC,MAAAA,CAAOC,MAAM,CAACX,iBAAAA;;"}
@@ -1,9 +1,16 @@
1
+ import { IconReference } from '../icons';
2
+ import { ComponentDesignModeDescriptor } from './ComponentDesignModeDescriptor';
1
3
  import { DesignTimeActionDescriptor } from './DesignTimeActionDescriptor';
2
4
  import { PropertyDescriptor } from './PropertyDescriptor';
3
5
  export interface ComponentDescriptor {
4
6
  component: string;
5
7
  displayName?: string;
6
8
  description?: string;
9
+ category?: string;
10
+ icon?: IconReference;
11
+ badge?: string;
12
+ keywords?: string[];
13
+ designMode?: ComponentDesignModeDescriptor;
7
14
  editorKind?: string;
8
15
  properties: PropertyDescriptor[];
9
16
  actions?: DesignTimeActionDescriptor[];
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentDescriptor.d.ts","sourceRoot":"","sources":["../../../descriptors/ComponentDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAS1D,MAAM,WAAW,mBAAmB;IAKhC,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IAGjC,OAAO,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAGvC,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,gCAAgC,EAAE,CAAC,MAAM,mBAAmB,CAAC,EAEzE,CAAC"}
1
+ {"version":3,"file":"ComponentDescriptor.d.ts","sourceRoot":"","sources":["../../../descriptors/ComponentDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAS1D,MAAM,WAAW,mBAAmB;IAKhC,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,IAAI,CAAC,EAAE,aAAa,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpB,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAG3C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IAGjC,OAAO,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAGvC,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,gCAAgC,EAAE,CAAC,MAAM,mBAAmB,CAAC,EAEzE,CAAC"}
@@ -4,6 +4,11 @@ const ComponentDescriptorPropertyNames = [
4
4
  'component',
5
5
  'displayName',
6
6
  'description',
7
+ 'category',
8
+ 'icon',
9
+ 'badge',
10
+ 'keywords',
11
+ 'designMode',
7
12
  'editorKind',
8
13
  'properties',
9
14
  'actions',
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentDescriptor.js","sources":["../../../descriptors/ComponentDescriptor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DesignTimeActionDescriptor } from './DesignTimeActionDescriptor';\nimport { PropertyDescriptor } from './PropertyDescriptor';\n\n/**\n * What can be edited on one component a package provides.\n *\n * Packages contribute these alongside the components themselves (a bundle's `descriptors`), through the same\n * package mechanism that already carries components, layouts and themes - there is no second registry to keep in\n * step.\n */\nexport interface ComponentDescriptor {\n /**\n * The component this describes, as the package names it: `<package>:<bare name>`, the same key a bundle\n * registers the component under (for example `Cratis.Components:dataTable`).\n */\n component: string;\n\n /** A human-readable name for a palette or an inspector title. */\n displayName?: string;\n\n description?: string;\n\n /** Names a specialised editor for the component as a whole, when its properties are not edited one by one. */\n editorKind?: string;\n\n properties: PropertyDescriptor[];\n\n /** Package-provided design-time actions for this component. */\n actions?: DesignTimeActionDescriptor[];\n\n /** Names an optional package-provided preview renderer. */\n previewKind?: string;\n\n /** Names an optional package-provided property display renderer set. */\n propertyDisplayKind?: string;\n}\n\nexport const ComponentDescriptorPropertyNames: (keyof ComponentDescriptor)[] = [\n 'component', 'displayName', 'description', 'editorKind', 'properties', 'actions', 'previewKind', 'propertyDisplayKind',\n];\n"],"names":["ComponentDescriptorPropertyNames"],"mappings":"AAAA;AACA;MAuCaA,gCAAAA,GAAkE;AAC3E,IAAA,WAAA;AAAa,IAAA,aAAA;AAAe,IAAA,aAAA;AAAe,IAAA,YAAA;AAAc,IAAA,YAAA;AAAc,IAAA,SAAA;AAAW,IAAA,aAAA;AAAe,IAAA;;;"}
1
+ {"version":3,"file":"ComponentDescriptor.js","sources":["../../../descriptors/ComponentDescriptor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { IconReference } from '../icons';\nimport { ComponentDesignModeDescriptor } from './ComponentDesignModeDescriptor';\nimport { DesignTimeActionDescriptor } from './DesignTimeActionDescriptor';\nimport { PropertyDescriptor } from './PropertyDescriptor';\n\n/**\n * What can be edited on one component a package provides.\n *\n * Packages contribute these alongside the components themselves (a bundle's `descriptors`), through the same\n * package mechanism that already carries components, layouts and themes - there is no second registry to keep in\n * step.\n */\nexport interface ComponentDescriptor {\n /**\n * The component this describes, as the package names it: `<package>:<bare name>`, the same key a bundle\n * registers the component under (for example `Cratis.Components:dataTable`).\n */\n component: string;\n\n /** A human-readable name for a palette or an inspector title. */\n displayName?: string;\n\n description?: string;\n\n /**\n * The group a component picker lists the component under (rule CMP1: every component declares one). One of\n * {@link ComponentCategory}, or a category the package adds. Optional in the type so a descriptor can be built up in steps;\n * `validateComponentDescriptors` reports a component that ends without one.\n */\n category?: string;\n\n /** The icon a picker shows for the component. */\n icon?: IconReference;\n\n /** Two letters a picker shows when it has no icon to draw. Absent means derive them from `displayName` (`componentBadge`). */\n badge?: string;\n\n /** Words a picker's filter matches besides the name and the category - \"grid\" for a data table. */\n keywords?: string[];\n\n /** How the component is edited directly on the design surface, as data. */\n designMode?: ComponentDesignModeDescriptor;\n\n /** Names a specialised editor for the component as a whole, when its properties are not edited one by one. */\n editorKind?: string;\n\n properties: PropertyDescriptor[];\n\n /** Package-provided design-time actions for this component. */\n actions?: DesignTimeActionDescriptor[];\n\n /** Names an optional package-provided preview renderer. */\n previewKind?: string;\n\n /** Names an optional package-provided property display renderer set. */\n propertyDisplayKind?: string;\n}\n\nexport const ComponentDescriptorPropertyNames: (keyof ComponentDescriptor)[] = [\n 'component', 'displayName', 'description', 'category', 'icon', 'badge', 'keywords', 'designMode', 'editorKind', 'properties', 'actions', 'previewKind', 'propertyDisplayKind',\n];\n"],"names":["ComponentDescriptorPropertyNames"],"mappings":"AAAA;AACA;MA4DaA,gCAAAA,GAAkE;AAC3E,IAAA,WAAA;AAAa,IAAA,aAAA;AAAe,IAAA,aAAA;AAAe,IAAA,UAAA;AAAY,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,UAAA;AAAY,IAAA,YAAA;AAAc,IAAA,YAAA;AAAc,IAAA,YAAA;AAAc,IAAA,SAAA;AAAW,IAAA,aAAA;AAAe,IAAA;;;"}
@@ -0,0 +1,24 @@
1
+ import { IconReference } from '../icons';
2
+ export interface DesignModeAddAction {
3
+ id: string;
4
+ label: string;
5
+ icon?: IconReference;
6
+ collectionPath?: string;
7
+ }
8
+ export interface DesignModeItemAction {
9
+ id: string;
10
+ icon: IconReference;
11
+ title: string;
12
+ compact?: boolean;
13
+ availability?: string;
14
+ readOnlyReason?: string;
15
+ }
16
+ export interface ComponentDesignModeDescriptor {
17
+ itemsPath?: string;
18
+ addActions: DesignModeAddAction[];
19
+ itemToolbar: DesignModeItemAction[];
20
+ }
21
+ export declare const DesignModeAddActionPropertyNames: (keyof DesignModeAddAction)[];
22
+ export declare const DesignModeItemActionPropertyNames: (keyof DesignModeItemAction)[];
23
+ export declare const ComponentDesignModeDescriptorPropertyNames: (keyof ComponentDesignModeDescriptor)[];
24
+ //# sourceMappingURL=ComponentDesignModeDescriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentDesignModeDescriptor.d.ts","sourceRoot":"","sources":["../../../descriptors/ComponentDesignModeDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMzC,MAAM,WAAW,mBAAmB;IAEhC,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,aAAa,CAAC;IAOrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,MAAM,WAAW,oBAAoB;IAEjC,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,aAAa,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,MAAM,WAAW,6BAA6B;IAK1C,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAGlC,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,gCAAgC,EAAE,CAAC,MAAM,mBAAmB,CAAC,EAA8C,CAAC;AACzH,eAAO,MAAM,iCAAiC,EAAE,CAAC,MAAM,oBAAoB,CAAC,EAAyE,CAAC;AACtJ,eAAO,MAAM,0CAA0C,EAAE,CAAC,MAAM,6BAA6B,CAAC,EAA+C,CAAC"}
@@ -0,0 +1,24 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ const DesignModeAddActionPropertyNames = [
4
+ 'id',
5
+ 'label',
6
+ 'icon',
7
+ 'collectionPath'
8
+ ];
9
+ const DesignModeItemActionPropertyNames = [
10
+ 'id',
11
+ 'icon',
12
+ 'title',
13
+ 'compact',
14
+ 'availability',
15
+ 'readOnlyReason'
16
+ ];
17
+ const ComponentDesignModeDescriptorPropertyNames = [
18
+ 'itemsPath',
19
+ 'addActions',
20
+ 'itemToolbar'
21
+ ];
22
+
23
+ export { ComponentDesignModeDescriptorPropertyNames, DesignModeAddActionPropertyNames, DesignModeItemActionPropertyNames };
24
+ //# sourceMappingURL=ComponentDesignModeDescriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentDesignModeDescriptor.js","sources":["../../../descriptors/ComponentDesignModeDescriptor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { IconReference } from '../icons';\n\n/**\n * An affordance a designer shows on the design surface to add an item to a component (the \"+ Add tab\" button of a tab strip,\n * the \"Add item\" of a toolbar).\n */\nexport interface DesignModeAddAction {\n /** Stable identity, unique within the component. */\n id: string;\n\n /** The label the designer shows. */\n label: string;\n\n /** The icon the designer shows next to it. */\n icon?: IconReference;\n\n /**\n * The `Collection` property of the component the new item is added to - the add is the ordinary `AddCollectionItem` edit. Absent,\n * the item is added to the component's own items, which the host resolves (the navigation region of a topbar, the children of a\n * toolbar).\n */\n collectionPath?: string;\n}\n\n/**\n * One button of the toolbar a designer shows over a selected item of a component.\n *\n * `availability` and `readOnlyReason` are rule *names*, interpreted by the package's design-time bundle exactly like\n * {@link DesignTimeActionDescriptor.availability}. The model carries no functions.\n */\nexport interface DesignModeItemAction {\n /** Stable identity, unique within the component. */\n id: string;\n\n /** The icon of the button. */\n icon: IconReference;\n\n /** The tooltip and accessible name of the button. */\n title: string;\n\n /** The button is shown without its title, in a tight row. */\n compact?: boolean;\n\n /** Names the rule that decides whether the button is shown and enabled for an item. Absent means always. */\n availability?: string;\n\n /** Names the rule that says why a read-only (inherited) item hides or disables the button. */\n readOnlyReason?: string;\n}\n\n/**\n * How a component is edited directly on the design surface: where its items are and which affordances the designer offers for\n * them. Plain data - a Visual Studio-style designer reads it without loading the component. Every edit it causes is a normal model edit\n * (`AddCollectionItem`, `RemoveCollectionItem`, `ReorderCollectionItems`, `EditCollectionItem`), so undo, redo and the dirty state\n * need nothing of their own.\n */\nexport interface ComponentDesignModeDescriptor {\n /**\n * The `Collection` property whose rows are the component's items. Absent when the items are not a property of the\n * component but something the host resolves - the navigation items of a topbar, the children of a toolbar.\n */\n itemsPath?: string;\n\n /** The \"add\" affordances. */\n addActions: DesignModeAddAction[];\n\n /** The buttons over a selected item. */\n itemToolbar: DesignModeItemAction[];\n}\n\nexport const DesignModeAddActionPropertyNames: (keyof DesignModeAddAction)[] = ['id', 'label', 'icon', 'collectionPath'];\nexport const DesignModeItemActionPropertyNames: (keyof DesignModeItemAction)[] = ['id', 'icon', 'title', 'compact', 'availability', 'readOnlyReason'];\nexport const ComponentDesignModeDescriptorPropertyNames: (keyof ComponentDesignModeDescriptor)[] = ['itemsPath', 'addActions', 'itemToolbar'];\n"],"names":["DesignModeAddActionPropertyNames","DesignModeItemActionPropertyNames","ComponentDesignModeDescriptorPropertyNames"],"mappings":"AAAA;AACA;MAwEaA,gCAAAA,GAAkE;AAAC,IAAA,IAAA;AAAM,IAAA,OAAA;AAAS,IAAA,MAAA;AAAQ,IAAA;;MAC1FC,iCAAAA,GAAoE;AAAC,IAAA,IAAA;AAAM,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,SAAA;AAAW,IAAA,cAAA;AAAgB,IAAA;;MACvHC,0CAAAA,GAAsF;AAAC,IAAA,WAAA;AAAa,IAAA,YAAA;AAAc,IAAA;;;"}
@@ -2,6 +2,7 @@ import { BindingMode, BindingSourceKind } from '../common';
2
2
  import { CollectionItemDescriptor } from './CollectionItemDescriptor';
3
3
  import { PropertyChoice } from './PropertyChoice';
4
4
  import { PropertyConstraints } from './PropertyConstraints';
5
+ import { PropertyEditorOptions } from './PropertyEditorOptions';
5
6
  import { PropertyValueType } from './PropertyValueType';
6
7
  export interface PropertyDescriptor {
7
8
  path: string;
@@ -12,6 +13,7 @@ export interface PropertyDescriptor {
12
13
  default?: unknown;
13
14
  constraints?: PropertyConstraints;
14
15
  editorKind?: string;
16
+ editorOptions?: PropertyEditorOptions;
15
17
  description?: string;
16
18
  item?: CollectionItemDescriptor;
17
19
  properties?: PropertyDescriptor[];
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyDescriptor.d.ts","sourceRoot":"","sources":["../../../descriptors/PropertyDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,MAAM,WAAW,kBAAkB;IAK/B,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,iBAAiB,CAAC;IAG7B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAG3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAOhC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAOlC,IAAI,CAAC,EAAE,OAAO,CAAC;IAGf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,oBAAoB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAG3C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,+BAA+B,EAAE,CAAC,MAAM,kBAAkB,CAAC,EAGvE,CAAC"}
1
+ {"version":3,"file":"PropertyDescriptor.d.ts","sourceRoot":"","sources":["../../../descriptors/PropertyDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,MAAM,WAAW,kBAAkB;IAK/B,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,iBAAiB,CAAC;IAG7B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAG3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAGtC,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAOhC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAOlC,IAAI,CAAC,EAAE,OAAO,CAAC;IAGf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,oBAAoB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAG3C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,+BAA+B,EAAE,CAAC,MAAM,kBAAkB,CAAC,EAGvE,CAAC"}
@@ -9,6 +9,7 @@ const PropertyDescriptorPropertyNames = [
9
9
  'default',
10
10
  'constraints',
11
11
  'editorKind',
12
+ 'editorOptions',
12
13
  'description',
13
14
  'item',
14
15
  'properties',
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyDescriptor.js","sources":["../../../descriptors/PropertyDescriptor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingMode, BindingSourceKind } from '../common';\nimport { CollectionItemDescriptor } from './CollectionItemDescriptor';\nimport { PropertyChoice } from './PropertyChoice';\nimport { PropertyConstraints } from './PropertyConstraints';\nimport { PropertyValueType } from './PropertyValueType';\n\n/**\n * Describes one editable property of a node: where it lives, what it is called, what it may hold and how a host\n * should edit it. A descriptor is plain data, so packages ship them and Studio reads them without loading a\n * component.\n */\nexport interface PropertyDescriptor {\n /**\n * Where the value lives. For an `ExternalComponent` it is a key (or dotted key path) in the element's\n * `properties` bag; for a model-native node such as a flow container it is the node's own property name.\n */\n path: string;\n\n /** The label an editor shows. */\n label: string;\n\n /** The editor section the property belongs to. */\n group: string;\n\n valueType: PropertyValueType;\n\n /** The allowed values of an `Enum` property. */\n choices?: PropertyChoice[];\n\n /** The value in effect when none is set. */\n default?: unknown;\n\n constraints?: PropertyConstraints;\n\n /**\n * Names a specialised editor. A host maps the name to its own editor - an icon picker, a query binder - and\n * falls back to the default editor for `valueType` when it does not know the name.\n */\n editorKind?: string;\n\n /** A sentence of help for the editor. */\n description?: string;\n\n /** Describes the items of a `Collection` property. Required when `valueType` is `Collection`. */\n item?: CollectionItemDescriptor;\n\n /**\n * Describes the fields of an `Object` property. A field's `path` is a single name relative to the object, and\n * a field may itself be an `Object` or a `Collection`, so a structured value of any depth can be described.\n * Without it an `Object` value is only editable through a specialised `editorKind`.\n */\n properties?: PropertyDescriptor[];\n\n /**\n * An `Object` property's value may carry fields `properties` does not describe. They are kept as they are and never\n * edited. Without it a field the descriptor does not describe is refused. Use it when `properties` lists the fields an\n * editor offers but the stored value may legitimately have more - a chart dataset, a record read from a sample.\n */\n open?: boolean;\n\n /** The value is shown but never edited. */\n readOnly?: boolean;\n\n /** This property is emitted by the component and may be bound by other elements. */\n output?: boolean;\n\n /** Which binding source kinds may be assigned to this property. */\n acceptedBindingKinds?: BindingSourceKind[];\n\n /** The strongest binding mode the property supports. */\n bindingMode?: BindingMode;\n}\n\nexport const PropertyDescriptorPropertyNames: (keyof PropertyDescriptor)[] = [\n 'path', 'label', 'group', 'valueType', 'choices', 'default', 'constraints', 'editorKind', 'description', 'item', 'properties', 'open', 'readOnly',\n 'output', 'acceptedBindingKinds', 'bindingMode',\n];\n"],"names":["PropertyDescriptorPropertyNames"],"mappings":"AAAA;AACA;MA2EaA,+BAAAA,GAAgE;AACzE,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,OAAA;AAAS,IAAA,WAAA;AAAa,IAAA,SAAA;AAAW,IAAA,SAAA;AAAW,IAAA,aAAA;AAAe,IAAA,YAAA;AAAc,IAAA,aAAA;AAAe,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA,MAAA;AAAQ,IAAA,UAAA;AACvI,IAAA,QAAA;AAAU,IAAA,sBAAA;AAAwB,IAAA;;;"}
1
+ {"version":3,"file":"PropertyDescriptor.js","sources":["../../../descriptors/PropertyDescriptor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingMode, BindingSourceKind } from '../common';\nimport { CollectionItemDescriptor } from './CollectionItemDescriptor';\nimport { PropertyChoice } from './PropertyChoice';\nimport { PropertyConstraints } from './PropertyConstraints';\nimport { PropertyEditorOptions } from './PropertyEditorOptions';\nimport { PropertyValueType } from './PropertyValueType';\n\n/**\n * Describes one editable property of a node: where it lives, what it is called, what it may hold and how a host\n * should edit it. A descriptor is plain data, so packages ship them and Studio reads them without loading a\n * component.\n */\nexport interface PropertyDescriptor {\n /**\n * Where the value lives. For an `ExternalComponent` it is a key (or dotted key path) in the element's\n * `properties` bag; for a model-native node such as a flow container it is the node's own property name.\n */\n path: string;\n\n /** The label an editor shows. */\n label: string;\n\n /** The editor section the property belongs to. */\n group: string;\n\n valueType: PropertyValueType;\n\n /** The allowed values of an `Enum` property. */\n choices?: PropertyChoice[];\n\n /** The value in effect when none is set. */\n default?: unknown;\n\n constraints?: PropertyConstraints;\n\n /**\n * Names a specialised editor. A host maps the name to its own editor - an icon picker, a query binder - and\n * falls back to the default editor for `valueType` when it does not know the name.\n */\n editorKind?: string;\n\n /** The parameters of the named editor - multi-line, placeholder, unit, step, slice kinds, the reference filter. */\n editorOptions?: PropertyEditorOptions;\n\n /** A sentence of help for the editor. */\n description?: string;\n\n /** Describes the items of a `Collection` property. Required when `valueType` is `Collection`. */\n item?: CollectionItemDescriptor;\n\n /**\n * Describes the fields of an `Object` property. A field's `path` is a single name relative to the object, and\n * a field may itself be an `Object` or a `Collection`, so a structured value of any depth can be described.\n * Without it an `Object` value is only editable through a specialised `editorKind`.\n */\n properties?: PropertyDescriptor[];\n\n /**\n * An `Object` property's value may carry fields `properties` does not describe. They are kept as they are and never\n * edited. Without it a field the descriptor does not describe is refused. Use it when `properties` lists the fields an\n * editor offers but the stored value may legitimately have more - a chart dataset, a record read from a sample.\n */\n open?: boolean;\n\n /** The value is shown but never edited. */\n readOnly?: boolean;\n\n /** This property is emitted by the component and may be bound by other elements. */\n output?: boolean;\n\n /** Which binding source kinds may be assigned to this property. */\n acceptedBindingKinds?: BindingSourceKind[];\n\n /** The strongest binding mode the property supports. */\n bindingMode?: BindingMode;\n}\n\nexport const PropertyDescriptorPropertyNames: (keyof PropertyDescriptor)[] = [\n 'path', 'label', 'group', 'valueType', 'choices', 'default', 'constraints', 'editorKind', 'editorOptions', 'description', 'item', 'properties', 'open', 'readOnly',\n 'output', 'acceptedBindingKinds', 'bindingMode',\n];\n"],"names":["PropertyDescriptorPropertyNames"],"mappings":"AAAA;AACA;MA+EaA,+BAAAA,GAAgE;AACzE,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,OAAA;AAAS,IAAA,WAAA;AAAa,IAAA,SAAA;AAAW,IAAA,SAAA;AAAW,IAAA,aAAA;AAAe,IAAA,YAAA;AAAc,IAAA,eAAA;AAAiB,IAAA,aAAA;AAAe,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA,MAAA;AAAQ,IAAA,UAAA;AACxJ,IAAA,QAAA;AAAU,IAAA,sBAAA;AAAwB,IAAA;;;"}
@@ -4,6 +4,23 @@ export declare const PropertyEditorKind: {
4
4
  readonly StringOrList: 'stringOrList';
5
5
  readonly Scalar: 'scalar';
6
6
  readonly StringMap: 'stringMap';
7
+ readonly Text: 'text';
8
+ readonly Number: 'number';
9
+ readonly Boolean: 'boolean';
10
+ readonly Enum: 'enum';
11
+ readonly Select: 'select';
12
+ readonly Color: 'color';
13
+ readonly Icon: 'icon';
14
+ readonly List: 'list';
15
+ readonly Reference: 'reference';
16
+ readonly NavigationTarget: 'navigationTarget';
17
+ readonly RenderingSlot: 'renderingSlot';
18
+ readonly Slice: 'slice';
19
+ readonly InheritanceMode: 'inheritanceMode';
20
+ readonly Template: 'template';
21
+ readonly SampleData: 'sampleData';
22
+ readonly Field: 'field';
23
+ readonly ColumnList: 'columnList';
7
24
  };
8
25
  export type PropertyEditorKind = (typeof PropertyEditorKind)[keyof typeof PropertyEditorKind];
9
26
  //# sourceMappingURL=PropertyEditorKind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyEditorKind.d.ts","sourceRoot":"","sources":["../../../descriptors/PropertyEditorKind.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB;aAE3B,UAAU,EAAE,YAAY;aAGxB,UAAU,EAAE,YAAY;aAGxB,YAAY,EAAE,cAAc;aAG5B,MAAM,EAAE,QAAQ;aAGhB,SAAS,EAAE,WAAW;CAChB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"PropertyEditorKind.d.ts","sourceRoot":"","sources":["../../../descriptors/PropertyEditorKind.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,kBAAkB;aAE3B,UAAU,EAAE,YAAY;aAGxB,UAAU,EAAE,YAAY;aAGxB,YAAY,EAAE,cAAc;aAG5B,MAAM,EAAE,QAAQ;aAGhB,SAAS,EAAE,WAAW;aAGtB,IAAI,EAAE,MAAM;aAGZ,MAAM,EAAE,QAAQ;aAGhB,OAAO,EAAE,SAAS;aAGlB,IAAI,EAAE,MAAM;aAGZ,MAAM,EAAE,QAAQ;aAGhB,KAAK,EAAE,OAAO;aAGd,IAAI,EAAE,MAAM;aAGZ,IAAI,EAAE,MAAM;aAGZ,SAAS,EAAE,WAAW;aAGtB,gBAAgB,EAAE,kBAAkB;aAGpC,aAAa,EAAE,eAAe;aAG9B,KAAK,EAAE,OAAO;aAGd,eAAe,EAAE,iBAAiB;aAGlC,QAAQ,EAAE,UAAU;aAGpB,UAAU,EAAE,YAAY;aAGxB,KAAK,EAAE,OAAO;aAGd,UAAU,EAAE,YAAY;CAClB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,7 +1,11 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
  /**
4
- * The editor kinds for values that have no fields to describe, so a host can edit them without asking for JSON text.
4
+ * The editor ids Studio's property-editor registry resolves (spec section 8). A property names one in `editorKind`; a host that
5
+ * does not know the id falls back to the default editor for `valueType`, and a package may name ids of its own (they are strings).
6
+ * This vocabulary defines only the ids and, in {@link PropertyEditorOptions}, their parameters - the editors themselves belong to the host.
7
+ *
8
+ * It starts with the editors for values that have no fields to describe, so a host can edit them without asking for JSON text.
5
9
  *
6
10
  * A list of plain values is a `json` property - Scene keeps the array exactly as authored - whose `editorKind` says what
7
11
  * its entries are. A record whose keys are the author's own (a row of data, keyed by column) is an `object` property
@@ -11,7 +15,24 @@
11
15
  /** An ordered list of numbers. */ NumberList: 'numberList',
12
16
  /** One word, or an ordered list of words: a chart colour is one colour for the series or one for each point. */ StringOrList: 'stringOrList',
13
17
  /** One word, number or flag - a value whose type the author chooses, such as the selected value of a control whose options carry any of them. */ Scalar: 'scalar',
14
- /** A record of words, numbers and flags under names the author chooses. */ StringMap: 'stringMap'
18
+ /** A record of words, numbers and flags under names the author chooses. */ StringMap: 'stringMap',
19
+ /** A single line of text; `editorOptions.multiline` makes it a box, `editorOptions.placeholder` hints it. */ Text: 'text',
20
+ /** A number; `constraints.minimum`/`maximum` and `editorOptions.step`/`unit` shape it. */ Number: 'number',
21
+ /** A switch with a label. */ Boolean: 'boolean',
22
+ /** Up to four choices as segmented chips. */ Enum: 'enum',
23
+ /** Any number of choices as a dropdown with a filter. */ Select: 'select',
24
+ /** A theme token first, a custom colour second. */ Color: 'color',
25
+ /** An icon from a searchable grid. */ Icon: 'icon',
26
+ /** A list of simple items: add, remove, reorder rows. */ List: 'list',
27
+ /** The id of another model element, from a searchable dropdown restricted by `editorOptions.reference`. */ Reference: 'reference',
28
+ /** The target of a navigation item: a Module > Feature tree, shown as a breadcrumb when closed. */ NavigationTarget: 'navigationTarget',
29
+ /** One of the slots of the effective template, with a mini diagram of its position. */ RenderingSlot: 'renderingSlot',
30
+ /** A slice from the slice tree; `editorOptions.kinds` (for example `['StateChange']`) filters, the rest are listed disabled with a reason. */ Slice: 'slice',
31
+ /** How a region relates to what it inherits: `inherit`, `extend` or `override`, as a three-way control. */ InheritanceMode: 'inheritanceMode',
32
+ /** A reference to a template, chosen through the template picker. */ Template: 'template',
33
+ /** A reference to a sample data pack. */ SampleData: 'sampleData',
34
+ /** A field of the shape a component is bound to, typed by `editorOptions.fieldKinds`. */ Field: 'field',
35
+ /** The columns of a table: rows of `{ field, header, width, align, format }`. */ ColumnList: 'columnList'
15
36
  };
16
37
 
17
38
  export { PropertyEditorKind };
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyEditorKind.js","sources":["../../../descriptors/PropertyEditorKind.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The editor kinds for values that have no fields to describe, so a host can edit them without asking for JSON text.\n *\n * A list of plain values is a `json` property - Scene keeps the array exactly as authored - whose `editorKind` says what\n * its entries are. A record whose keys are the author's own (a row of data, keyed by column) is an `object` property\n * with no `properties` and the `stringMap` kind. A host that does not know a kind falls back to its default editor.\n */\nexport const PropertyEditorKind = {\n /** An ordered list of words. */\n StringList: 'stringList',\n\n /** An ordered list of numbers. */\n NumberList: 'numberList',\n\n /** One word, or an ordered list of words: a chart colour is one colour for the series or one for each point. */\n StringOrList: 'stringOrList',\n\n /** One word, number or flag - a value whose type the author chooses, such as the selected value of a control whose options carry any of them. */\n Scalar: 'scalar',\n\n /** A record of words, numbers and flags under names the author chooses. */\n StringMap: 'stringMap',\n} as const;\n\nexport type PropertyEditorKind = (typeof PropertyEditorKind)[keyof typeof PropertyEditorKind];\n"],"names":["PropertyEditorKind","StringList","NumberList","StringOrList","Scalar","StringMap"],"mappings":"AAAA;AACA;AAEA;;;;;;UAOaA,kBAAAA,GAAqB;AAC9B,qCACAC,UAAAA,EAAY,YAAA;AAEZ,uCACAC,UAAAA,EAAY,YAAA;AAEZ,qHACAC,YAAAA,EAAc,cAAA;AAEd,sJACAC,MAAAA,EAAQ,QAAA;AAER,gFACAC,SAAAA,EAAW;AACf;;"}
1
+ {"version":3,"file":"PropertyEditorKind.js","sources":["../../../descriptors/PropertyEditorKind.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The editor ids Studio's property-editor registry resolves (spec section 8). A property names one in `editorKind`; a host that\n * does not know the id falls back to the default editor for `valueType`, and a package may name ids of its own (they are strings).\n * This vocabulary defines only the ids and, in {@link PropertyEditorOptions}, their parameters - the editors themselves belong to the host.\n *\n * It starts with the editors for values that have no fields to describe, so a host can edit them without asking for JSON text.\n *\n * A list of plain values is a `json` property - Scene keeps the array exactly as authored - whose `editorKind` says what\n * its entries are. A record whose keys are the author's own (a row of data, keyed by column) is an `object` property\n * with no `properties` and the `stringMap` kind. A host that does not know a kind falls back to its default editor.\n */\nexport const PropertyEditorKind = {\n /** An ordered list of words. */\n StringList: 'stringList',\n\n /** An ordered list of numbers. */\n NumberList: 'numberList',\n\n /** One word, or an ordered list of words: a chart colour is one colour for the series or one for each point. */\n StringOrList: 'stringOrList',\n\n /** One word, number or flag - a value whose type the author chooses, such as the selected value of a control whose options carry any of them. */\n Scalar: 'scalar',\n\n /** A record of words, numbers and flags under names the author chooses. */\n StringMap: 'stringMap',\n\n /** A single line of text; `editorOptions.multiline` makes it a box, `editorOptions.placeholder` hints it. */\n Text: 'text',\n\n /** A number; `constraints.minimum`/`maximum` and `editorOptions.step`/`unit` shape it. */\n Number: 'number',\n\n /** A switch with a label. */\n Boolean: 'boolean',\n\n /** Up to four choices as segmented chips. */\n Enum: 'enum',\n\n /** Any number of choices as a dropdown with a filter. */\n Select: 'select',\n\n /** A theme token first, a custom colour second. */\n Color: 'color',\n\n /** An icon from a searchable grid. */\n Icon: 'icon',\n\n /** A list of simple items: add, remove, reorder rows. */\n List: 'list',\n\n /** The id of another model element, from a searchable dropdown restricted by `editorOptions.reference`. */\n Reference: 'reference',\n\n /** The target of a navigation item: a Module > Feature tree, shown as a breadcrumb when closed. */\n NavigationTarget: 'navigationTarget',\n\n /** One of the slots of the effective template, with a mini diagram of its position. */\n RenderingSlot: 'renderingSlot',\n\n /** A slice from the slice tree; `editorOptions.kinds` (for example `['StateChange']`) filters, the rest are listed disabled with a reason. */\n Slice: 'slice',\n\n /** How a region relates to what it inherits: `inherit`, `extend` or `override`, as a three-way control. */\n InheritanceMode: 'inheritanceMode',\n\n /** A reference to a template, chosen through the template picker. */\n Template: 'template',\n\n /** A reference to a sample data pack. */\n SampleData: 'sampleData',\n\n /** A field of the shape a component is bound to, typed by `editorOptions.fieldKinds`. */\n Field: 'field',\n\n /** The columns of a table: rows of `{ field, header, width, align, format }`. */\n ColumnList: 'columnList',\n} as const;\n\nexport type PropertyEditorKind = (typeof PropertyEditorKind)[keyof typeof PropertyEditorKind];\n"],"names":["PropertyEditorKind","StringList","NumberList","StringOrList","Scalar","StringMap","Text","Number","Boolean","Enum","Select","Color","Icon","List","Reference","NavigationTarget","RenderingSlot","Slice","InheritanceMode","Template","SampleData","Field","ColumnList"],"mappings":"AAAA;AACA;AAEA;;;;;;;;;;UAWaA,kBAAAA,GAAqB;AAC9B,qCACAC,UAAAA,EAAY,YAAA;AAEZ,uCACAC,UAAAA,EAAY,YAAA;AAEZ,qHACAC,YAAAA,EAAc,cAAA;AAEd,sJACAC,MAAAA,EAAQ,QAAA;AAER,gFACAC,SAAAA,EAAW,WAAA;AAEX,kHACAC,IAAAA,EAAM,MAAA;AAEN,+FACAC,MAAAA,EAAQ,QAAA;AAER,kCACAC,OAAAA,EAAS,SAAA;AAET,kDACAC,IAAAA,EAAM,MAAA;AAEN,8DACAC,MAAAA,EAAQ,QAAA;AAER,wDACAC,KAAAA,EAAO,OAAA;AAEP,2CACAC,IAAAA,EAAM,MAAA;AAEN,8DACAC,IAAAA,EAAM,MAAA;AAEN,gHACAC,SAAAA,EAAW,WAAA;AAEX,wGACAC,gBAAAA,EAAkB,kBAAA;AAElB,4FACAC,aAAAA,EAAe,eAAA;AAEf,mJACAC,KAAAA,EAAO,OAAA;AAEP,gHACAC,eAAAA,EAAiB,iBAAA;AAEjB,0EACAC,QAAAA,EAAU,UAAA;AAEV,8CACAC,UAAAA,EAAY,YAAA;AAEZ,8FACAC,KAAAA,EAAO,OAAA;AAEP,sFACAC,UAAAA,EAAY;AAChB;;"}
@@ -0,0 +1,18 @@
1
+ export interface ReferenceFilterDescriptor {
2
+ target: string;
3
+ kinds?: string[];
4
+ predicate?: string;
5
+ }
6
+ export interface PropertyEditorOptions {
7
+ multiline?: boolean;
8
+ placeholder?: string;
9
+ unit?: string;
10
+ step?: number;
11
+ kinds?: string[];
12
+ reference?: ReferenceFilterDescriptor;
13
+ fieldKinds?: string[];
14
+ tokensOnly?: boolean;
15
+ }
16
+ export declare const ReferenceFilterDescriptorPropertyNames: (keyof ReferenceFilterDescriptor)[];
17
+ export declare const PropertyEditorOptionsPropertyNames: (keyof PropertyEditorOptions)[];
18
+ //# sourceMappingURL=PropertyEditorOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyEditorOptions.d.ts","sourceRoot":"","sources":["../../../descriptors/PropertyEditorOptions.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,yBAAyB;IAEtC,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAGjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,MAAM,WAAW,qBAAqB;IAElC,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAGjB,SAAS,CAAC,EAAE,yBAAyB,CAAC;IAGtC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAGtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,sCAAsC,EAAE,CAAC,MAAM,yBAAyB,CAAC,EAAqC,CAAC;AAC5H,eAAO,MAAM,kCAAkC,EAAE,CAAC,MAAM,qBAAqB,CAAC,EAE7E,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * What a `reference` editor offers: the model elements of one kind, narrowed by a named rule.
5
+ */ const ReferenceFilterDescriptorPropertyNames = [
6
+ 'target',
7
+ 'kinds',
8
+ 'predicate'
9
+ ];
10
+ const PropertyEditorOptionsPropertyNames = [
11
+ 'multiline',
12
+ 'placeholder',
13
+ 'unit',
14
+ 'step',
15
+ 'kinds',
16
+ 'reference',
17
+ 'fieldKinds',
18
+ 'tokensOnly'
19
+ ];
20
+
21
+ export { PropertyEditorOptionsPropertyNames, ReferenceFilterDescriptorPropertyNames };
22
+ //# sourceMappingURL=PropertyEditorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyEditorOptions.js","sources":["../../../descriptors/PropertyEditorOptions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * What a `reference` editor offers: the model elements of one kind, narrowed by a named rule.\n */\nexport interface ReferenceFilterDescriptor {\n /** The kind of model element referenced: `screen`, `slice`, `template`, `shape`, `field` ... A host maps it to what it can list. */\n target: string;\n\n /** Narrows the target to these kinds (a slice is a `StateChange`, a `ReadModel` ...). Absent means every kind. */\n kinds?: string[];\n\n /** Names the rule that decides which candidates are offered, interpreted by the host - like `availability` of a design-time action. */\n predicate?: string;\n}\n\n/**\n * The parameters of a named editor, alongside `PropertyDescriptor.editorKind`: the bits a generic editor needs that are not a value\n * constraint. Every field is optional and only the ones an editor documents are read.\n */\nexport interface PropertyEditorOptions {\n /** `text`: a multi-line box instead of a single line. */\n multiline?: boolean;\n\n /** `text`: the hint shown while empty. */\n placeholder?: string;\n\n /** `number`: the unit shown after the value (`px`, `%`, `ms`). */\n unit?: string;\n\n /** `number`: the increment of a stepper. The range is `constraints.minimum` and `constraints.maximum`. */\n step?: number;\n\n /** `slice`: the slice kinds that can be chosen (`['StateChange']`); others are listed disabled with a reason. */\n kinds?: string[];\n\n /** `reference`: what can be referenced. Required by the `reference` editor. */\n reference?: ReferenceFilterDescriptor;\n\n /** `field`: the kinds of field offered (`string`, `number`, `boolean` ...). Absent means any. */\n fieldKinds?: string[];\n\n /** `color`: only theme tokens, no custom colour. */\n tokensOnly?: boolean;\n}\n\nexport const ReferenceFilterDescriptorPropertyNames: (keyof ReferenceFilterDescriptor)[] = ['target', 'kinds', 'predicate'];\nexport const PropertyEditorOptionsPropertyNames: (keyof PropertyEditorOptions)[] = [\n 'multiline', 'placeholder', 'unit', 'step', 'kinds', 'reference', 'fieldKinds', 'tokensOnly',\n];\n"],"names":["ReferenceFilterDescriptorPropertyNames","PropertyEditorOptionsPropertyNames"],"mappings":"AAAA;AACA;AAEA;;UA4CaA,sCAAAA,GAA8E;AAAC,IAAA,QAAA;AAAU,IAAA,OAAA;AAAS,IAAA;;MAClGC,kCAAAA,GAAsE;AAC/E,IAAA,WAAA;AAAa,IAAA,aAAA;AAAe,IAAA,MAAA;AAAQ,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,WAAA;AAAa,IAAA,YAAA;AAAc,IAAA;;;"}
@@ -0,0 +1,4 @@
1
+ import { IconReference } from '../icons';
2
+ export declare const componentIconLibrary = "Cratis.Icons.Lucide";
3
+ export declare function componentIcon(key: string): IconReference;
4
+ //# sourceMappingURL=componentIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentIcon.d.ts","sourceRoot":"","sources":["../../../descriptors/componentIcon.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAG1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAExD"}
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * The icon library the built-in components' icons come from: the Lucide library package a Cratis host ships. A component's icon is an
5
+ * ordinary {@link IconReference}, so a host without that library shows the component's badge instead (see the component picker) and
6
+ * the icon diagnostics report it like any other icon.
7
+ */ const componentIconLibrary = 'Cratis.Icons.Lucide';
8
+ /** The icon with this key in {@link componentIconLibrary}. */ function componentIcon(key) {
9
+ return {
10
+ library: componentIconLibrary,
11
+ key
12
+ };
13
+ }
14
+
15
+ export { componentIcon, componentIconLibrary };
16
+ //# sourceMappingURL=componentIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentIcon.js","sources":["../../../descriptors/componentIcon.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { IconReference } from '../icons';\n\n/**\n * The icon library the built-in components' icons come from: the Lucide library package a Cratis host ships. A component's icon is an\n * ordinary {@link IconReference}, so a host without that library shows the component's badge instead (see the component picker) and\n * the icon diagnostics report it like any other icon.\n */\nexport const componentIconLibrary = 'Cratis.Icons.Lucide';\n\n/** The icon with this key in {@link componentIconLibrary}. */\nexport function componentIcon(key: string): IconReference {\n return { library: componentIconLibrary, key };\n}\n"],"names":["componentIconLibrary","componentIcon","key","library"],"mappings":"AAAA;AACA;AAIA;;;;IAKO,MAAMA,oBAAAA,GAAuB;AAEpC,+DACO,SAASC,aAAAA,CAAcC,GAAW,EAAA;IACrC,OAAO;QAAEC,OAAAA,EAASH,oBAAAA;AAAsBE,QAAAA;AAAI,KAAA;AAChD;;"}
@@ -1,5 +1,6 @@
1
1
  export * from './PropertyValueType';
2
2
  export * from './PropertyEditorKind';
3
+ export * from './PropertyEditorOptions';
3
4
  export * from './PropertyChoice';
4
5
  export * from './PropertyConstraints';
5
6
  export * from './CollectionItemDescriptor';
@@ -7,6 +8,9 @@ export * from './DesignTimeActionDescriptor';
7
8
  export * from './DesignTimeActionPlacement';
8
9
  export * from './PackageDesignTimeMetadata';
9
10
  export * from './PropertyDescriptor';
11
+ export * from './ComponentCategory';
12
+ export * from './ComponentDesignModeDescriptor';
13
+ export * from './componentIcon';
10
14
  export * from './ComponentDescriptor';
11
15
  export * from './CollectionOperation';
12
16
  export * from './LayoutType';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './PropertyValueType';
2
2
  export * from './PropertyEditorKind';
3
+ export * from './PropertyEditorOptions';
3
4
  export * from './PropertyChoice';
4
5
  export * from './PropertyConstraints';
5
6
  export * from './CollectionItemDescriptor';
@@ -7,6 +8,9 @@ export * from './DesignTimeActionDescriptor';
7
8
  export * from './DesignTimeActionPlacement';
8
9
  export * from './PackageDesignTimeMetadata';
9
10
  export * from './PropertyDescriptor';
11
+ export * from './ComponentCategory';
12
+ export * from './ComponentDesignModeDescriptor';
13
+ export * from './componentIcon';
10
14
  export * from './ComponentDescriptor';
11
15
  export * from './CollectionOperation';
12
16
  export * from './LayoutType';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}