@cratis/scene.model 4.3.0 → 4.5.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 (74) hide show
  1. package/common/index.ts +0 -1
  2. package/dist/cjs/editing/DiagnosticCode.js +7 -0
  3. package/dist/cjs/editing/DiagnosticCode.js.map +1 -1
  4. package/dist/cjs/icons/IconEntry.js +22 -0
  5. package/dist/cjs/icons/IconEntry.js.map +1 -0
  6. package/dist/cjs/icons/IconLibrary.js +22 -0
  7. package/dist/cjs/icons/IconLibrary.js.map +1 -0
  8. package/dist/cjs/icons/IconReference.js +23 -0
  9. package/dist/cjs/icons/IconReference.js.map +1 -0
  10. package/dist/cjs/icons/iconReferences.js +61 -0
  11. package/dist/cjs/icons/iconReferences.js.map +1 -0
  12. package/dist/cjs/index.js +11 -2
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/packages/PackageKind.js +12 -1
  15. package/dist/cjs/packages/PackageKind.js.map +1 -1
  16. package/dist/cjs/packages/ScenePackage.js +2 -1
  17. package/dist/cjs/packages/ScenePackage.js.map +1 -1
  18. package/dist/esm/common/index.d.ts +0 -1
  19. package/dist/esm/common/index.d.ts.map +1 -1
  20. package/dist/esm/common/index.js +0 -1
  21. package/dist/esm/common/index.js.map +1 -1
  22. package/dist/esm/editing/DiagnosticCode.d.ts +7 -1
  23. package/dist/esm/editing/DiagnosticCode.d.ts.map +1 -1
  24. package/dist/esm/editing/DiagnosticCode.js +7 -0
  25. package/dist/esm/editing/DiagnosticCode.js.map +1 -1
  26. package/dist/esm/icons/IconEntry.d.ts +10 -0
  27. package/dist/esm/icons/IconEntry.d.ts.map +1 -0
  28. package/dist/esm/icons/IconEntry.js +20 -0
  29. package/dist/esm/icons/IconEntry.js.map +1 -0
  30. package/dist/esm/icons/IconLibrary.d.ts +9 -0
  31. package/dist/esm/icons/IconLibrary.d.ts.map +1 -0
  32. package/dist/esm/icons/IconLibrary.js +20 -0
  33. package/dist/esm/icons/IconLibrary.js.map +1 -0
  34. package/dist/esm/icons/IconReference.d.ts.map +1 -0
  35. package/dist/esm/icons/IconReference.js +21 -0
  36. package/dist/esm/icons/IconReference.js.map +1 -0
  37. package/dist/esm/icons/iconReferences.d.ts +6 -0
  38. package/dist/esm/icons/iconReferences.d.ts.map +1 -0
  39. package/dist/esm/icons/iconReferences.js +56 -0
  40. package/dist/esm/icons/iconReferences.js.map +1 -0
  41. package/dist/esm/icons/index.d.ts +5 -0
  42. package/dist/esm/icons/index.d.ts.map +1 -0
  43. package/dist/esm/icons/index.js +5 -0
  44. package/dist/esm/icons/index.js.map +1 -0
  45. package/dist/esm/index.d.ts +1 -0
  46. package/dist/esm/index.d.ts.map +1 -1
  47. package/dist/esm/index.js +4 -1
  48. package/dist/esm/index.js.map +1 -1
  49. package/dist/esm/packages/PackageKind.d.ts +2 -1
  50. package/dist/esm/packages/PackageKind.d.ts.map +1 -1
  51. package/dist/esm/packages/PackageKind.js +12 -1
  52. package/dist/esm/packages/PackageKind.js.map +1 -1
  53. package/dist/esm/packages/ScenePackage.d.ts +2 -0
  54. package/dist/esm/packages/ScenePackage.d.ts.map +1 -1
  55. package/dist/esm/packages/ScenePackage.js +2 -1
  56. package/dist/esm/packages/ScenePackage.js.map +1 -1
  57. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  58. package/editing/DiagnosticCode.ts +8 -0
  59. package/icons/IconEntry.ts +45 -0
  60. package/icons/IconLibrary.ts +42 -0
  61. package/icons/IconReference.ts +35 -0
  62. package/icons/iconReferences.ts +62 -0
  63. package/icons/index.ts +7 -0
  64. package/index.ts +1 -0
  65. package/package.json +1 -1
  66. package/packages/PackageKind.ts +14 -1
  67. package/packages/ScenePackage.ts +7 -0
  68. package/common/IconReference.ts +0 -22
  69. package/dist/cjs/common/IconReference.js +0 -18
  70. package/dist/cjs/common/IconReference.js.map +0 -1
  71. package/dist/esm/common/IconReference.d.ts.map +0 -1
  72. package/dist/esm/common/IconReference.js +0 -16
  73. package/dist/esm/common/IconReference.js.map +0 -1
  74. /package/dist/esm/{common → icons}/IconReference.d.ts +0 -0
package/common/index.ts CHANGED
@@ -12,5 +12,4 @@ export * from './Orientation';
12
12
  export * from './Dock';
13
13
  export * from './GridUnitType';
14
14
  export * from './GridLength';
15
- export * from './IconReference';
16
15
  export * from './DestinationReference';
@@ -50,6 +50,13 @@
50
50
  DiagnosticCode["CollectionItemNotFound"] = "collectionItemNotFound";
51
51
  DiagnosticCode["DuplicateCollectionItem"] = "duplicateCollectionItem";
52
52
  DiagnosticCode["UnknownInstance"] = "unknownInstance";
53
+ // Icons
54
+ DiagnosticCode["MissingIconLibrary"] = "missingIconLibrary";
55
+ DiagnosticCode["MissingIcon"] = "missingIcon";
56
+ DiagnosticCode["MissingIconVariant"] = "missingIconVariant";
57
+ DiagnosticCode["IncompatibleIconLibrary"] = "incompatibleIconLibrary";
58
+ DiagnosticCode["IconCatalogUnavailable"] = "iconCatalogUnavailable";
59
+ DiagnosticCode["IconNotVerified"] = "iconNotVerified";
53
60
  return DiagnosticCode;
54
61
  }({});
55
62
 
@@ -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"],"names":["DiagnosticCode"],"mappings":";;AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AAkDX,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"],"names":["DiagnosticCode"],"mappings":";;AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AA0DX,CAAA,CAAA,EAAA;;"}
@@ -0,0 +1,22 @@
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
+ /**
6
+ * One icon in an icon library's catalog: what a picker needs to find it and a reference needs to name it.
7
+ *
8
+ * An entry is metadata only. It holds no SVG, class name or component - that is the renderer's concern,
9
+ * resolved lazily per icon by the adapter - so a catalog is cheap to load and identical for every
10
+ * renderer. The {@link IconReference} that names the icon is the entry's `key` (and one of its
11
+ * `variants`) together with the library the catalog belongs to.
12
+ */ const IconEntryPropertyNames = [
13
+ 'key',
14
+ 'name',
15
+ 'categories',
16
+ 'aliases',
17
+ 'tags',
18
+ 'variants'
19
+ ];
20
+
21
+ exports.IconEntryPropertyNames = IconEntryPropertyNames;
22
+ //# sourceMappingURL=IconEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconEntry.js","sources":["../../../icons/IconEntry.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 * One icon in an icon library's catalog: what a picker needs to find it and a reference needs to name it.\n *\n * An entry is metadata only. It holds no SVG, class name or component - that is the renderer's concern,\n * resolved lazily per icon by the adapter - so a catalog is cheap to load and identical for every\n * renderer. The {@link IconReference} that names the icon is the entry's `key` (and one of its\n * `variants`) together with the library the catalog belongs to.\n */\nexport interface IconEntry {\n /**\n * The stable key within the library; what an {@link IconReference} persists.\n */\n key: string;\n\n /**\n * The display name a picker shows. Never identity - two libraries may share a name.\n */\n name: string;\n\n /**\n * The categories the icon is filed under, for browsing.\n */\n categories: string[];\n\n /**\n * Alternative names to find the icon by (`bin` for `trash`).\n */\n aliases?: string[];\n\n /**\n * Free-form search terms.\n */\n tags?: string[];\n\n /**\n * The variants this icon exists in. Absent or empty when the icon has no variants, in which case\n * references to it carry none.\n */\n variants?: string[];\n}\n\nexport const IconEntryPropertyNames: (keyof IconEntry)[] = ['key', 'name', 'categories', 'aliases', 'tags', 'variants'];\n"],"names":["IconEntryPropertyNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;UAyCaA,sBAAAA,GAA8C;AAAC,IAAA,KAAA;AAAO,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA;;;"}
@@ -0,0 +1,22 @@
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
+ /**
6
+ * What a {@link ScenePackage} of kind {@link PackageKind.IconLibrary} declares about its icons, beyond
7
+ * what every package declares (name, version, license, dependencies, module).
8
+ *
9
+ * It is deliberately small. The icons themselves are not listed here: a library can ship thousands, and a
10
+ * profile resolution that read every key of every library would defeat the point of resolving without
11
+ * loading anything. The icon *catalog* - an {@link IconEntry} per icon - is loaded on demand from the
12
+ * library's module, and each icon's artwork is loaded per icon by the renderer's adapter.
13
+ */ const IconLibraryPropertyNames = [
14
+ 'variants',
15
+ 'renderers',
16
+ 'attribution',
17
+ 'attributionUrl',
18
+ 'iconCount'
19
+ ];
20
+
21
+ exports.IconLibraryPropertyNames = IconLibraryPropertyNames;
22
+ //# sourceMappingURL=IconLibrary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconLibrary.js","sources":["../../../icons/IconLibrary.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 {@link ScenePackage} of kind {@link PackageKind.IconLibrary} declares about its icons, beyond\n * what every package declares (name, version, license, dependencies, module).\n *\n * It is deliberately small. The icons themselves are not listed here: a library can ship thousands, and a\n * profile resolution that read every key of every library would defeat the point of resolving without\n * loading anything. The icon *catalog* - an {@link IconEntry} per icon - is loaded on demand from the\n * library's module, and each icon's artwork is loaded per icon by the renderer's adapter.\n */\nexport interface IconLibrary {\n /**\n * The style variants the library offers (`outline`, `solid` ...), empty when it has a single style.\n * Declared here so a picker can offer variant filters before it has loaded the catalog.\n */\n variants: string[];\n\n /**\n * The renderers the library ships an adapter for (`react` ...), so tooling can say whether the\n * library can render for the target a profile selects without loading it.\n */\n renderers: string[];\n\n /**\n * The credit line the library's license asks to be shown, for example \"Icons by Lucide contributors\".\n */\n attribution?: string;\n\n /**\n * Where the attribution points - the library's home or license page.\n */\n attributionUrl?: string;\n\n /**\n * How many icons the catalog holds, for a picker's \"1,500 icons\" before the catalog is loaded.\n */\n iconCount?: number;\n}\n\nexport const IconLibraryPropertyNames: (keyof IconLibrary)[] = ['variants', 'renderers', 'attribution', 'attributionUrl', 'iconCount'];\n"],"names":["IconLibraryPropertyNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;UAsCaA,wBAAAA,GAAkD;AAAC,IAAA,UAAA;AAAY,IAAA,WAAA;AAAa,IAAA,aAAA;AAAe,IAAA,gBAAA;AAAkB,IAAA;;;"}
@@ -0,0 +1,23 @@
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
+ /**
6
+ * The persisted, renderer-neutral identity of one icon: which icon library it comes from, which icon
7
+ * inside that library, and optionally which style variant of it.
8
+ *
9
+ * This is the only form in which a screen, template, blueprint or profile refers to an icon. It carries
10
+ * no CSS class, no SVG and no component - those belong to a renderer's adapter for the library - so the
11
+ * same reference renders on the web, on a phone, or anywhere else a library has an adapter.
12
+ *
13
+ * Identity is all three fields. A display name, a catalog position or a CSS class is never identity:
14
+ * two libraries can each ship an icon called `home`, and `{ library: 'a', key: 'home' }` and
15
+ * `{ library: 'b', key: 'home' }` are different icons that are never silently swapped for one another.
16
+ */ const IconReferencePropertyNames = [
17
+ 'library',
18
+ 'key',
19
+ 'variant'
20
+ ];
21
+
22
+ exports.IconReferencePropertyNames = IconReferencePropertyNames;
23
+ //# sourceMappingURL=IconReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconReference.js","sources":["../../../icons/IconReference.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 persisted, renderer-neutral identity of one icon: which icon library it comes from, which icon\n * inside that library, and optionally which style variant of it.\n *\n * This is the only form in which a screen, template, blueprint or profile refers to an icon. It carries\n * no CSS class, no SVG and no component - those belong to a renderer's adapter for the library - so the\n * same reference renders on the web, on a phone, or anywhere else a library has an adapter.\n *\n * Identity is all three fields. A display name, a catalog position or a CSS class is never identity:\n * two libraries can each ship an icon called `home`, and `{ library: 'a', key: 'home' }` and\n * `{ library: 'b', key: 'home' }` are different icons that are never silently swapped for one another.\n */\nexport interface IconReference {\n /**\n * The identity of the icon library - the `name` of the {@link ScenePackage} of kind\n * {@link PackageKind.IconLibrary} that provides the icon.\n */\n library: string;\n\n /**\n * The stable key of the icon inside its library. Stable means a library keeps the key across\n * versions for as long as it ships the icon; it is not the icon's display name.\n */\n key: string;\n\n /**\n * The style variant (`outline`, `solid`, `filled` ...), or absent for a library or icon that has none.\n */\n variant?: string;\n}\n\nexport const IconReferencePropertyNames: (keyof IconReference)[] = ['library', 'key', 'variant'];\n"],"names":["IconReferencePropertyNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;UA+BaA,0BAAAA,GAAsD;AAAC,IAAA,SAAA;AAAW,IAAA,KAAA;AAAO,IAAA;;;"}
@@ -0,0 +1,61 @@
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
+ /**
6
+ * The character that separates the parts of an icon reference's text form. A reference's parts therefore
7
+ * cannot contain it - an npm package name, an icon key and a variant name never do.
8
+ */ const separator = '#';
9
+ function isPart(value) {
10
+ return typeof value === 'string' && value.length > 0 && !value.includes(separator);
11
+ }
12
+ /**
13
+ * Whether a value is a well-formed {@link IconReference}: a library and a key that are non-empty, an
14
+ * optional non-empty variant, none of them containing the text-form separator. Extra properties are
15
+ * tolerated, because a reference read from a persisted document may carry editor-added metadata.
16
+ */ function isIconReference(value) {
17
+ if (typeof value !== 'object' || value === null) return false;
18
+ const candidate = value;
19
+ return isPart(candidate.library) && isPart(candidate.key) && (candidate.variant === undefined || isPart(candidate.variant));
20
+ }
21
+ /**
22
+ * Whether two references name the same icon. Equality is all three fields - library, key and variant -
23
+ * and nothing else; an absent variant equals only another absent variant.
24
+ */ function iconReferencesEqual(left, right) {
25
+ return left.library === right.library && left.key === right.key && (left.variant ?? undefined) === (right.variant ?? undefined);
26
+ }
27
+ /**
28
+ * The canonical single-string form of a reference, for keys, logs and diagnostics:
29
+ * `library#key`, or `library#key#variant`. Two references are equal exactly when their text forms are equal.
30
+ * It is a convenience for people and tools, not the persisted shape - persist the {@link IconReference}.
31
+ *
32
+ * @throws Error when a part is empty or contains `#`.
33
+ */ function formatIconReference(reference) {
34
+ if (!isIconReference(reference)) {
35
+ throw new Error(`'${JSON.stringify(reference)}' is not a valid icon reference: library and key are required, and no part may be empty or contain '${separator}'`);
36
+ }
37
+ return reference.variant === undefined ? `${reference.library}${separator}${reference.key}` : `${reference.library}${separator}${reference.key}${separator}${reference.variant}`;
38
+ }
39
+ /**
40
+ * Reads the text form produced by {@link formatIconReference}. Returns `undefined` for anything that is
41
+ * not one - including a bare legacy icon name such as `pi pi-home`, which has no library and so cannot be
42
+ * made into a reference without choosing one.
43
+ */ function parseIconReference(text) {
44
+ const parts = text.split(separator);
45
+ if (parts.length < 2 || parts.length > 3 || !parts.every(isPart)) return undefined;
46
+ const [library, key, variant] = parts;
47
+ return variant === undefined ? {
48
+ library,
49
+ key
50
+ } : {
51
+ library,
52
+ key,
53
+ variant
54
+ };
55
+ }
56
+
57
+ exports.formatIconReference = formatIconReference;
58
+ exports.iconReferencesEqual = iconReferencesEqual;
59
+ exports.isIconReference = isIconReference;
60
+ exports.parseIconReference = parseIconReference;
61
+ //# sourceMappingURL=iconReferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconReferences.js","sources":["../../../icons/iconReferences.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 './IconReference';\n\n/**\n * The character that separates the parts of an icon reference's text form. A reference's parts therefore\n * cannot contain it - an npm package name, an icon key and a variant name never do.\n */\nconst separator = '#';\n\nfunction isPart(value: unknown): value is string {\n return typeof value === 'string' && value.length > 0 && !value.includes(separator);\n}\n\n/**\n * Whether a value is a well-formed {@link IconReference}: a library and a key that are non-empty, an\n * optional non-empty variant, none of them containing the text-form separator. Extra properties are\n * tolerated, because a reference read from a persisted document may carry editor-added metadata.\n */\nexport function isIconReference(value: unknown): value is IconReference {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as Record<string, unknown>;\n return isPart(candidate.library) && isPart(candidate.key) && (candidate.variant === undefined || isPart(candidate.variant));\n}\n\n/**\n * Whether two references name the same icon. Equality is all three fields - library, key and variant -\n * and nothing else; an absent variant equals only another absent variant.\n */\nexport function iconReferencesEqual(left: IconReference, right: IconReference): boolean {\n return left.library === right.library && left.key === right.key && (left.variant ?? undefined) === (right.variant ?? undefined);\n}\n\n/**\n * The canonical single-string form of a reference, for keys, logs and diagnostics:\n * `library#key`, or `library#key#variant`. Two references are equal exactly when their text forms are equal.\n * It is a convenience for people and tools, not the persisted shape - persist the {@link IconReference}.\n *\n * @throws Error when a part is empty or contains `#`.\n */\nexport function formatIconReference(reference: IconReference): string {\n if (!isIconReference(reference)) {\n throw new Error(`'${JSON.stringify(reference)}' is not a valid icon reference: library and key are required, and no part may be empty or contain '${separator}'`);\n }\n\n return reference.variant === undefined\n ? `${reference.library}${separator}${reference.key}`\n : `${reference.library}${separator}${reference.key}${separator}${reference.variant}`;\n}\n\n/**\n * Reads the text form produced by {@link formatIconReference}. Returns `undefined` for anything that is\n * not one - including a bare legacy icon name such as `pi pi-home`, which has no library and so cannot be\n * made into a reference without choosing one.\n */\nexport function parseIconReference(text: string): IconReference | undefined {\n const parts = text.split(separator);\n if (parts.length < 2 || parts.length > 3 || !parts.every(isPart)) return undefined;\n const [library, key, variant] = parts;\n return variant === undefined ? { library, key } : { library, key, variant };\n}\n"],"names":["separator","isPart","value","length","includes","isIconReference","candidate","library","key","variant","undefined","iconReferencesEqual","left","right","formatIconReference","reference","Error","JSON","stringify","parseIconReference","text","parts","split","every"],"mappings":";;AAAA;AACA;AAIA;;;AAGC,IACD,MAAMA,SAAAA,GAAY,GAAA;AAElB,SAASC,OAAOC,KAAc,EAAA;IAC1B,OAAO,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,CAAMC,MAAM,GAAG,CAAA,IAAK,CAACD,KAAAA,CAAME,QAAQ,CAACJ,SAAAA,CAAAA;AAC5E;AAEA;;;;IAKO,SAASK,eAAAA,CAAgBH,KAAc,EAAA;AAC1C,IAAA,IAAI,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,KAAU,MAAM,OAAO,KAAA;AACxD,IAAA,MAAMI,SAAAA,GAAYJ,KAAAA;AAClB,IAAA,OAAOD,OAAOK,SAAAA,CAAUC,OAAO,CAAA,IAAKN,MAAAA,CAAOK,UAAUE,GAAG,CAAA,KAAMF,SAAAA,CAAUG,OAAO,KAAKC,SAAAA,IAAaT,MAAAA,CAAOK,SAAAA,CAAUG,OAAO,CAAA,CAAA;AAC7H;AAEA;;;AAGC,IACM,SAASE,mBAAAA,CAAoBC,IAAmB,EAAEC,KAAoB,EAAA;IACzE,OAAOD,IAAAA,CAAKL,OAAO,KAAKM,KAAAA,CAAMN,OAAO,IAAIK,IAAAA,CAAKJ,GAAG,KAAKK,KAAAA,CAAML,GAAG,IAAI,CAACI,IAAAA,CAAKH,OAAO,IAAIC,SAAQ,OAAQG,KAAAA,CAAMJ,OAAO,IAAIC,SAAQ,CAAA;AACjI;AAEA;;;;;;IAOO,SAASI,mBAAAA,CAAoBC,SAAwB,EAAA;IACxD,IAAI,CAACV,gBAAgBU,SAAAA,CAAAA,EAAY;AAC7B,QAAA,MAAM,IAAIC,KAAAA,CAAM,CAAC,CAAC,EAAEC,IAAAA,CAAKC,SAAS,CAACH,SAAAA,CAAAA,CAAW,oGAAoG,EAAEf,SAAAA,CAAU,CAAC,CAAC,CAAA;AACpK,IAAA;IAEA,OAAOe,SAAAA,CAAUN,OAAO,KAAKC,SAAAA,GACvB,CAAA,EAAGK,UAAUR,OAAO,CAAA,EAAGP,SAAAA,CAAAA,EAAYe,SAAAA,CAAUP,GAAG,CAAA,CAAE,GAClD,CAAA,EAAGO,SAAAA,CAAUR,OAAO,CAAA,EAAGP,SAAAA,CAAAA,EAAYe,SAAAA,CAAUP,GAAG,CAAA,EAAGR,SAAAA,CAAAA,EAAYe,SAAAA,CAAUN,OAAO,CAAA,CAAE;AAC5F;AAEA;;;;IAKO,SAASU,kBAAAA,CAAmBC,IAAY,EAAA;IAC3C,MAAMC,KAAAA,GAAQD,IAAAA,CAAKE,KAAK,CAACtB,SAAAA,CAAAA;AACzB,IAAA,IAAIqB,KAAAA,CAAMlB,MAAM,GAAG,CAAA,IAAKkB,KAAAA,CAAMlB,MAAM,GAAG,CAAA,IAAK,CAACkB,KAAAA,CAAME,KAAK,CAACtB,SAAS,OAAOS,SAAAA;AACzE,IAAA,MAAM,CAACH,OAAAA,EAASC,GAAAA,EAAKC,OAAAA,CAAQ,GAAGY,KAAAA;AAChC,IAAA,OAAOZ,YAAYC,SAAAA,GAAY;AAAEH,QAAAA,OAAAA;AAASC,QAAAA;KAAI,GAAI;AAAED,QAAAA,OAAAA;AAASC,QAAAA,GAAAA;AAAKC,QAAAA;AAAQ,KAAA;AAC9E;;;;;"}
package/dist/cjs/index.js CHANGED
@@ -11,7 +11,6 @@ var Orientation = require('./common/Orientation.js');
11
11
  var Dock = require('./common/Dock.js');
12
12
  var GridUnitType = require('./common/GridUnitType.js');
13
13
  var GridLength = require('./common/GridLength.js');
14
- var IconReference = require('./common/IconReference.js');
15
14
  var DestinationReference = require('./common/DestinationReference.js');
16
15
  var WidthSizeClass = require('./sizeClasses/WidthSizeClass.js');
17
16
  var HeightSizeClass = require('./sizeClasses/HeightSizeClass.js');
@@ -59,6 +58,10 @@ var Contribution = require('./contributionPoints/Contribution.js');
59
58
  var NavigationItem = require('./contributionPoints/NavigationItem.js');
60
59
  var UiProfile = require('./profiles/UiProfile.js');
61
60
  var Theme = require('./profiles/Theme.js');
61
+ var IconReference = require('./icons/IconReference.js');
62
+ var iconReferences = require('./icons/iconReferences.js');
63
+ var IconLibrary = require('./icons/IconLibrary.js');
64
+ var IconEntry = require('./icons/IconEntry.js');
62
65
  var PackageKind = require('./packages/PackageKind.js');
63
66
  var PackageDependency = require('./packages/PackageDependency.js');
64
67
  var ScenePackage = require('./packages/ScenePackage.js');
@@ -159,7 +162,6 @@ exports.Orientation = Orientation.Orientation;
159
162
  exports.Dock = Dock.Dock;
160
163
  exports.GridUnitType = GridUnitType.GridUnitType;
161
164
  exports.GridLengthPropertyNames = GridLength.GridLengthPropertyNames;
162
- exports.IconReferencePropertyNames = IconReference.IconReferencePropertyNames;
163
165
  exports.DestinationReferencePropertyNames = DestinationReference.DestinationReferencePropertyNames;
164
166
  exports.WidthSizeClass = WidthSizeClass.WidthSizeClass;
165
167
  exports.HeightSizeClass = HeightSizeClass.HeightSizeClass;
@@ -207,6 +209,13 @@ exports.ContributionPropertyNames = Contribution.ContributionPropertyNames;
207
209
  exports.NavigationItemPropertyNames = NavigationItem.NavigationItemPropertyNames;
208
210
  exports.UiProfilePropertyNames = UiProfile.UiProfilePropertyNames;
209
211
  exports.ThemePropertyNames = Theme.ThemePropertyNames;
212
+ exports.IconReferencePropertyNames = IconReference.IconReferencePropertyNames;
213
+ exports.formatIconReference = iconReferences.formatIconReference;
214
+ exports.iconReferencesEqual = iconReferences.iconReferencesEqual;
215
+ exports.isIconReference = iconReferences.isIconReference;
216
+ exports.parseIconReference = iconReferences.parseIconReference;
217
+ exports.IconLibraryPropertyNames = IconLibrary.IconLibraryPropertyNames;
218
+ exports.IconEntryPropertyNames = IconEntry.IconEntryPropertyNames;
210
219
  exports.PackageKind = PackageKind.PackageKind;
211
220
  exports.PackageDependencyPropertyNames = PackageDependency.PackageDependencyPropertyNames;
212
221
  exports.ScenePackagePropertyNames = ScenePackage.ScenePackagePropertyNames;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@
4
4
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
5
  /**
6
6
  * What a {@link ScenePackage} contributes to a {@link UiProfile}. A profile's package list mixes all
7
- * three kinds freely - the kind says what a package is for, never where it sits in the override-priority
7
+ * four kinds freely - the kind says what a package is for, never where it sits in the override-priority
8
8
  * order.
9
9
  */ var PackageKind = /*#__PURE__*/ function(PackageKind) {
10
10
  /**
@@ -27,6 +27,17 @@
27
27
  * against PrimeReact and Cratis Components, and says so. That is what makes "which blueprints can I
28
28
  * use" answerable from the packages a profile already has.
29
29
  */ PackageKind["Blueprint"] = "Blueprint";
30
+ /**
31
+ * Provides icons - a named, versioned library of them, such as Lucide or PrimeIcons - that screens,
32
+ * templates and blueprints refer to by {@link IconReference} rather than by CSS class or markup.
33
+ * A library declares its variants, renderer adapters and attribution through
34
+ * {@link ScenePackage.iconLibrary}; its icon catalog is loaded on demand, never listed in the package.
35
+ *
36
+ * It is a package kind rather than a contribution on another kind because everything an author asks
37
+ * of a library - select it in a profile, see its license and version, have it pulled in by the
38
+ * components that need it - is already what a package is. Several libraries coexist in one profile,
39
+ * and the library is part of every icon's identity, so same-named icons never shadow one another.
40
+ */ PackageKind["IconLibrary"] = "IconLibrary";
30
41
  return PackageKind;
31
42
  }({});
32
43
 
@@ -1 +1 @@
1
- {"version":3,"file":"PackageKind.js","sources":["../../../packages/PackageKind.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 {@link ScenePackage} contributes to a {@link UiProfile}. A profile's package list mixes all\n * three kinds freely - the kind says what a package is for, never where it sits in the override-priority\n * order.\n */\nexport enum PackageKind {\n /**\n * Declares component names a screen can resolve against. A package with no dependency on another\n * `ComponentLibrary` is a base library (PrimeReact, `core`); one that depends on another layers on\n * top of it.\n */\n ComponentLibrary = 'ComponentLibrary',\n\n /**\n * Contributes styling rather than components - a utility CSS system such as Tailwind. A styling\n * package usually declares no components at all; component libraries depend on it to say \"my\n * components are written against this styling system\".\n */\n Styling = 'Styling',\n\n /**\n * Provides the shape of an application: its {@link Layout}s, the {@link ScreenTemplate}s and\n * {@link DialogTemplate}s built on them, and the components that fill their slots. An application\n * selects one blueprint, and gets a coherent set rather than assembling layouts and templates from\n * unrelated sources.\n *\n * A blueprint depends on the component libraries it is built from — the default blueprint is written\n * against PrimeReact and Cratis Components, and says so. That is what makes \"which blueprints can I\n * use\" answerable from the packages a profile already has.\n */\n Blueprint = 'Blueprint',\n}\n"],"names":["PackageKind"],"mappings":";;AAAA;AACA;AAEA;;;;IAKO,IAAKA,WAAAA,iBAAAA,SAAAA,WAAAA,EAAAA;AACR;;;;AAIC,QAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAGD;;;;AAIC,QAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AAGD;;;;;;;;;AASC,QAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAA;AAxBOA,IAAAA,OAAAA,WAAAA;AA0BX,CAAA,CAAA,EAAA;;"}
1
+ {"version":3,"file":"PackageKind.js","sources":["../../../packages/PackageKind.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 {@link ScenePackage} contributes to a {@link UiProfile}. A profile's package list mixes all\n * four kinds freely - the kind says what a package is for, never where it sits in the override-priority\n * order.\n */\nexport enum PackageKind {\n /**\n * Declares component names a screen can resolve against. A package with no dependency on another\n * `ComponentLibrary` is a base library (PrimeReact, `core`); one that depends on another layers on\n * top of it.\n */\n ComponentLibrary = 'ComponentLibrary',\n\n /**\n * Contributes styling rather than components - a utility CSS system such as Tailwind. A styling\n * package usually declares no components at all; component libraries depend on it to say \"my\n * components are written against this styling system\".\n */\n Styling = 'Styling',\n\n /**\n * Provides the shape of an application: its {@link Layout}s, the {@link ScreenTemplate}s and\n * {@link DialogTemplate}s built on them, and the components that fill their slots. An application\n * selects one blueprint, and gets a coherent set rather than assembling layouts and templates from\n * unrelated sources.\n *\n * A blueprint depends on the component libraries it is built from — the default blueprint is written\n * against PrimeReact and Cratis Components, and says so. That is what makes \"which blueprints can I\n * use\" answerable from the packages a profile already has.\n */\n Blueprint = 'Blueprint',\n\n /**\n * Provides icons - a named, versioned library of them, such as Lucide or PrimeIcons - that screens,\n * templates and blueprints refer to by {@link IconReference} rather than by CSS class or markup.\n * A library declares its variants, renderer adapters and attribution through\n * {@link ScenePackage.iconLibrary}; its icon catalog is loaded on demand, never listed in the package.\n *\n * It is a package kind rather than a contribution on another kind because everything an author asks\n * of a library - select it in a profile, see its license and version, have it pulled in by the\n * components that need it - is already what a package is. Several libraries coexist in one profile,\n * and the library is part of every icon's identity, so same-named icons never shadow one another.\n */\n IconLibrary = 'IconLibrary',\n}\n"],"names":["PackageKind"],"mappings":";;AAAA;AACA;AAEA;;;;IAKO,IAAKA,WAAAA,iBAAAA,SAAAA,WAAAA,EAAAA;AACR;;;;AAIC,QAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAGD;;;;AAIC,QAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AAGD;;;;;;;;;AASC,QAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAA;AAGD;;;;;;;;;;AAUC,QAAA,WAAA,CAAA,aAAA,CAAA,GAAA,aAAA;AArCOA,IAAAA,OAAAA,WAAAA;AAuCX,CAAA,CAAA,EAAA;;"}
@@ -16,7 +16,8 @@ const ScenePackagePropertyNames = [
16
16
  'description',
17
17
  'module',
18
18
  'license',
19
- 'licenseUrl'
19
+ 'licenseUrl',
20
+ 'iconLibrary'
20
21
  ];
21
22
 
22
23
  exports.ScenePackagePropertyNames = ScenePackagePropertyNames;
@@ -1 +1 @@
1
- {"version":3,"file":"ScenePackage.js","sources":["../../../packages/ScenePackage.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 { PackageDependency } from './PackageDependency';\nimport { PackageKind } from './PackageKind';\n\n/**\n * What a {@link UiProfile}'s `packages` entry actually names. A profile lists packages by name only;\n * this is the declaration behind the name - what it contributes, and what else has to be active for it\n * to work.\n */\nexport interface ScenePackage {\n /**\n * The name a {@link UiProfile} lists, and the name a {@link PackageDependency} refers to.\n */\n name: string;\n\n /**\n * The package's own version, so a {@link PackageDependency.versionRange} has something to check against.\n */\n version: string;\n\n /**\n * What the package contributes.\n */\n kind: PackageKind;\n\n /**\n * Other packages that must be active in the same profile for this one to work.\n */\n dependencies: PackageDependency[];\n\n /**\n * The component names this package declares - the catalog entry {@link UiProfile} resolution walks.\n */\n components: string[];\n\n /**\n * The names of the {@link Layout}s this package provides — an application's base navigational shells.\n * Empty for anything that is not a {@link PackageKind.Blueprint}.\n */\n layouts: string[];\n\n /**\n * The names of the {@link ScreenTemplate}s this package provides — the shapes that go inside a layout,\n * at module, feature and slice level.\n */\n screenTemplates: string[];\n\n /**\n * The names of the {@link DialogTemplate}s this package provides.\n */\n dialogTemplates: string[];\n\n /**\n * The names of the {@link Theme}s this package ships, empty for a package that ships none.\n */\n themes: string[];\n\n /**\n * A human-readable name for a package picker, falling back to `name` when absent.\n */\n displayName?: string;\n\n /**\n * A one-line description for a package picker.\n */\n description?: string;\n\n /**\n * The module that implements the package - an npm package name for a web renderer. Design-time\n * tooling needs it to know what to import; the model itself never loads anything.\n */\n module?: string;\n\n /**\n * The license the package is available under, as a short human-readable name (`MIT`,\n * `PrimeUI Community`). A package picker shows it, because \"what am I taking on by selecting this\"\n * is a question an author needs answered before they select it, not after.\n */\n license?: string;\n\n /**\n * Where the license terms actually live, so a reader can go and check rather than take `license` on\n * trust. Required in practice for anything that is not a permissive standard license — a name alone\n * tells an author nothing about eligibility or obligations.\n */\n licenseUrl?: string;\n}\n\nexport const ScenePackagePropertyNames: (keyof ScenePackage)[] = [\n 'name',\n 'version',\n 'kind',\n 'dependencies',\n 'components',\n 'layouts',\n 'screenTemplates',\n 'dialogTemplates',\n 'themes',\n 'displayName',\n 'description',\n 'module',\n 'license',\n 'licenseUrl',\n];\n"],"names":["ScenePackagePropertyNames"],"mappings":";;AAAA;AACA;MAyFaA,yBAAAA,GAAoD;AAC7D,IAAA,MAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,cAAA;AACA,IAAA,YAAA;AACA,IAAA,SAAA;AACA,IAAA,iBAAA;AACA,IAAA,iBAAA;AACA,IAAA,QAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,QAAA;AACA,IAAA,SAAA;AACA,IAAA;;;"}
1
+ {"version":3,"file":"ScenePackage.js","sources":["../../../packages/ScenePackage.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 { IconLibrary } from '../icons';\nimport { PackageDependency } from './PackageDependency';\nimport { PackageKind } from './PackageKind';\n\n/**\n * What a {@link UiProfile}'s `packages` entry actually names. A profile lists packages by name only;\n * this is the declaration behind the name - what it contributes, and what else has to be active for it\n * to work.\n */\nexport interface ScenePackage {\n /**\n * The name a {@link UiProfile} lists, and the name a {@link PackageDependency} refers to.\n */\n name: string;\n\n /**\n * The package's own version, so a {@link PackageDependency.versionRange} has something to check against.\n */\n version: string;\n\n /**\n * What the package contributes.\n */\n kind: PackageKind;\n\n /**\n * Other packages that must be active in the same profile for this one to work.\n */\n dependencies: PackageDependency[];\n\n /**\n * The component names this package declares - the catalog entry {@link UiProfile} resolution walks.\n */\n components: string[];\n\n /**\n * The names of the {@link Layout}s this package provides — an application's base navigational shells.\n * Empty for anything that is not a {@link PackageKind.Blueprint}.\n */\n layouts: string[];\n\n /**\n * The names of the {@link ScreenTemplate}s this package provides — the shapes that go inside a layout,\n * at module, feature and slice level.\n */\n screenTemplates: string[];\n\n /**\n * The names of the {@link DialogTemplate}s this package provides.\n */\n dialogTemplates: string[];\n\n /**\n * The names of the {@link Theme}s this package ships, empty for a package that ships none.\n */\n themes: string[];\n\n /**\n * A human-readable name for a package picker, falling back to `name` when absent.\n */\n displayName?: string;\n\n /**\n * A one-line description for a package picker.\n */\n description?: string;\n\n /**\n * The module that implements the package - an npm package name for a web renderer. Design-time\n * tooling needs it to know what to import; the model itself never loads anything.\n */\n module?: string;\n\n /**\n * The license the package is available under, as a short human-readable name (`MIT`,\n * `PrimeUI Community`). A package picker shows it, because \"what am I taking on by selecting this\"\n * is a question an author needs answered before they select it, not after.\n */\n license?: string;\n\n /**\n * Where the license terms actually live, so a reader can go and check rather than take `license` on\n * trust. Required in practice for anything that is not a permissive standard license — a name alone\n * tells an author nothing about eligibility or obligations.\n */\n licenseUrl?: string;\n\n /**\n * What the package declares about its icons. Present exactly for a {@link PackageKind.IconLibrary}.\n */\n iconLibrary?: IconLibrary;\n}\n\nexport const ScenePackagePropertyNames: (keyof ScenePackage)[] = [\n 'name',\n 'version',\n 'kind',\n 'dependencies',\n 'components',\n 'layouts',\n 'screenTemplates',\n 'dialogTemplates',\n 'themes',\n 'displayName',\n 'description',\n 'module',\n 'license',\n 'licenseUrl',\n 'iconLibrary',\n];\n"],"names":["ScenePackagePropertyNames"],"mappings":";;AAAA;AACA;MA+FaA,yBAAAA,GAAoD;AAC7D,IAAA,MAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,cAAA;AACA,IAAA,YAAA;AACA,IAAA,SAAA;AACA,IAAA,iBAAA;AACA,IAAA,iBAAA;AACA,IAAA,QAAA;AACA,IAAA,aAAA;AACA,IAAA,aAAA;AACA,IAAA,QAAA;AACA,IAAA,SAAA;AACA,IAAA,YAAA;AACA,IAAA;;;"}
@@ -9,6 +9,5 @@ export * from './Orientation';
9
9
  export * from './Dock';
10
10
  export * from './GridUnitType';
11
11
  export * from './GridLength';
12
- export * from './IconReference';
13
12
  export * from './DestinationReference';
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
@@ -9,6 +9,5 @@ export * from './Orientation';
9
9
  export * from './Dock';
10
10
  export * from './GridUnitType';
11
11
  export * from './GridLength';
12
- export * from './IconReference';
13
12
  export * from './DestinationReference';
14
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
@@ -36,6 +36,12 @@ export declare enum DiagnosticCode {
36
36
  UnknownCollectionField = "unknownCollectionField",
37
37
  CollectionItemNotFound = "collectionItemNotFound",
38
38
  DuplicateCollectionItem = "duplicateCollectionItem",
39
- UnknownInstance = "unknownInstance"
39
+ UnknownInstance = "unknownInstance",
40
+ MissingIconLibrary = "missingIconLibrary",
41
+ MissingIcon = "missingIcon",
42
+ MissingIconVariant = "missingIconVariant",
43
+ IncompatibleIconLibrary = "incompatibleIconLibrary",
44
+ IconCatalogUnavailable = "iconCatalogUnavailable",
45
+ IconNotVerified = "iconNotVerified"
40
46
  }
41
47
  //# sourceMappingURL=DiagnosticCode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiagnosticCode.d.ts","sourceRoot":"","sources":["../../../editing/DiagnosticCode.ts"],"names":[],"mappings":"AAOA,oBAAY,cAAc;IAEtB,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,0BAA0B,+BAA+B;IAGzD,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,eAAe,oBAAoB;IAGnC,2BAA2B,gCAAgC;IAC3D,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,uBAAuB,4BAA4B;IACnD,gBAAgB,qBAAqB;IAGrC,YAAY,iBAAiB;IAC7B,uBAAuB,4BAA4B;IACnD,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IAGzC,qBAAqB,0BAA0B;IAC/C,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;IACrD,iCAAiC,sCAAsC;IACvE,sBAAsB,2BAA2B;IACjD,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,eAAe,oBAAoB;CACtC"}
1
+ {"version":3,"file":"DiagnosticCode.d.ts","sourceRoot":"","sources":["../../../editing/DiagnosticCode.ts"],"names":[],"mappings":"AAOA,oBAAY,cAAc;IAEtB,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,0BAA0B,+BAA+B;IAGzD,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,eAAe,oBAAoB;IAGnC,2BAA2B,gCAAgC;IAC3D,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,uBAAuB,4BAA4B;IACnD,gBAAgB,qBAAqB;IAGrC,YAAY,iBAAiB;IAC7B,uBAAuB,4BAA4B;IACnD,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IAGzC,qBAAqB,0BAA0B;IAC/C,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;IACrD,iCAAiC,sCAAsC;IACvE,sBAAsB,2BAA2B;IACjD,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,eAAe,oBAAoB;IAGnC,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;IACzC,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;CACtC"}
@@ -48,6 +48,13 @@
48
48
  DiagnosticCode["CollectionItemNotFound"] = "collectionItemNotFound";
49
49
  DiagnosticCode["DuplicateCollectionItem"] = "duplicateCollectionItem";
50
50
  DiagnosticCode["UnknownInstance"] = "unknownInstance";
51
+ // Icons
52
+ DiagnosticCode["MissingIconLibrary"] = "missingIconLibrary";
53
+ DiagnosticCode["MissingIcon"] = "missingIcon";
54
+ DiagnosticCode["MissingIconVariant"] = "missingIconVariant";
55
+ DiagnosticCode["IncompatibleIconLibrary"] = "incompatibleIconLibrary";
56
+ DiagnosticCode["IconCatalogUnavailable"] = "iconCatalogUnavailable";
57
+ DiagnosticCode["IconNotVerified"] = "iconNotVerified";
51
58
  return DiagnosticCode;
52
59
  }({});
53
60
 
@@ -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"],"names":["DiagnosticCode"],"mappings":"AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AAkDX,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"],"names":["DiagnosticCode"],"mappings":"AAAA;AACA;AAEA;;;IAIO,IAAKA,cAAAA,iBAAAA,SAAAA,cAAAA,EAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,IAAAA,OAAAA,cAAAA;AA0DX,CAAA,CAAA,EAAA;;"}
@@ -0,0 +1,10 @@
1
+ export interface IconEntry {
2
+ key: string;
3
+ name: string;
4
+ categories: string[];
5
+ aliases?: string[];
6
+ tags?: string[];
7
+ variants?: string[];
8
+ }
9
+ export declare const IconEntryPropertyNames: (keyof IconEntry)[];
10
+ //# sourceMappingURL=IconEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconEntry.d.ts","sourceRoot":"","sources":["../../../icons/IconEntry.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,SAAS;IAItB,GAAG,EAAE,MAAM,CAAC;IAKZ,IAAI,EAAE,MAAM,CAAC;IAKb,UAAU,EAAE,MAAM,EAAE,CAAC;IAKrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAKnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAMhB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,sBAAsB,EAAE,CAAC,MAAM,SAAS,CAAC,EAAiE,CAAC"}
@@ -0,0 +1,20 @@
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
+ * One icon in an icon library's catalog: what a picker needs to find it and a reference needs to name it.
5
+ *
6
+ * An entry is metadata only. It holds no SVG, class name or component - that is the renderer's concern,
7
+ * resolved lazily per icon by the adapter - so a catalog is cheap to load and identical for every
8
+ * renderer. The {@link IconReference} that names the icon is the entry's `key` (and one of its
9
+ * `variants`) together with the library the catalog belongs to.
10
+ */ const IconEntryPropertyNames = [
11
+ 'key',
12
+ 'name',
13
+ 'categories',
14
+ 'aliases',
15
+ 'tags',
16
+ 'variants'
17
+ ];
18
+
19
+ export { IconEntryPropertyNames };
20
+ //# sourceMappingURL=IconEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconEntry.js","sources":["../../../icons/IconEntry.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 * One icon in an icon library's catalog: what a picker needs to find it and a reference needs to name it.\n *\n * An entry is metadata only. It holds no SVG, class name or component - that is the renderer's concern,\n * resolved lazily per icon by the adapter - so a catalog is cheap to load and identical for every\n * renderer. The {@link IconReference} that names the icon is the entry's `key` (and one of its\n * `variants`) together with the library the catalog belongs to.\n */\nexport interface IconEntry {\n /**\n * The stable key within the library; what an {@link IconReference} persists.\n */\n key: string;\n\n /**\n * The display name a picker shows. Never identity - two libraries may share a name.\n */\n name: string;\n\n /**\n * The categories the icon is filed under, for browsing.\n */\n categories: string[];\n\n /**\n * Alternative names to find the icon by (`bin` for `trash`).\n */\n aliases?: string[];\n\n /**\n * Free-form search terms.\n */\n tags?: string[];\n\n /**\n * The variants this icon exists in. Absent or empty when the icon has no variants, in which case\n * references to it carry none.\n */\n variants?: string[];\n}\n\nexport const IconEntryPropertyNames: (keyof IconEntry)[] = ['key', 'name', 'categories', 'aliases', 'tags', 'variants'];\n"],"names":["IconEntryPropertyNames"],"mappings":"AAAA;AACA;AAEA;;;;;;;UAyCaA,sBAAAA,GAA8C;AAAC,IAAA,KAAA;AAAO,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA;;;"}
@@ -0,0 +1,9 @@
1
+ export interface IconLibrary {
2
+ variants: string[];
3
+ renderers: string[];
4
+ attribution?: string;
5
+ attributionUrl?: string;
6
+ iconCount?: number;
7
+ }
8
+ export declare const IconLibraryPropertyNames: (keyof IconLibrary)[];
9
+ //# sourceMappingURL=IconLibrary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconLibrary.d.ts","sourceRoot":"","sources":["../../../icons/IconLibrary.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAKxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IAMnB,SAAS,EAAE,MAAM,EAAE,CAAC;IAKpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,cAAc,CAAC,EAAE,MAAM,CAAC;IAKxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,EAAE,CAAC,MAAM,WAAW,CAAC,EAA4E,CAAC"}
@@ -0,0 +1,20 @@
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 {@link ScenePackage} of kind {@link PackageKind.IconLibrary} declares about its icons, beyond
5
+ * what every package declares (name, version, license, dependencies, module).
6
+ *
7
+ * It is deliberately small. The icons themselves are not listed here: a library can ship thousands, and a
8
+ * profile resolution that read every key of every library would defeat the point of resolving without
9
+ * loading anything. The icon *catalog* - an {@link IconEntry} per icon - is loaded on demand from the
10
+ * library's module, and each icon's artwork is loaded per icon by the renderer's adapter.
11
+ */ const IconLibraryPropertyNames = [
12
+ 'variants',
13
+ 'renderers',
14
+ 'attribution',
15
+ 'attributionUrl',
16
+ 'iconCount'
17
+ ];
18
+
19
+ export { IconLibraryPropertyNames };
20
+ //# sourceMappingURL=IconLibrary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconLibrary.js","sources":["../../../icons/IconLibrary.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 {@link ScenePackage} of kind {@link PackageKind.IconLibrary} declares about its icons, beyond\n * what every package declares (name, version, license, dependencies, module).\n *\n * It is deliberately small. The icons themselves are not listed here: a library can ship thousands, and a\n * profile resolution that read every key of every library would defeat the point of resolving without\n * loading anything. The icon *catalog* - an {@link IconEntry} per icon - is loaded on demand from the\n * library's module, and each icon's artwork is loaded per icon by the renderer's adapter.\n */\nexport interface IconLibrary {\n /**\n * The style variants the library offers (`outline`, `solid` ...), empty when it has a single style.\n * Declared here so a picker can offer variant filters before it has loaded the catalog.\n */\n variants: string[];\n\n /**\n * The renderers the library ships an adapter for (`react` ...), so tooling can say whether the\n * library can render for the target a profile selects without loading it.\n */\n renderers: string[];\n\n /**\n * The credit line the library's license asks to be shown, for example \"Icons by Lucide contributors\".\n */\n attribution?: string;\n\n /**\n * Where the attribution points - the library's home or license page.\n */\n attributionUrl?: string;\n\n /**\n * How many icons the catalog holds, for a picker's \"1,500 icons\" before the catalog is loaded.\n */\n iconCount?: number;\n}\n\nexport const IconLibraryPropertyNames: (keyof IconLibrary)[] = ['variants', 'renderers', 'attribution', 'attributionUrl', 'iconCount'];\n"],"names":["IconLibraryPropertyNames"],"mappings":"AAAA;AACA;AAEA;;;;;;;;UAsCaA,wBAAAA,GAAkD;AAAC,IAAA,UAAA;AAAY,IAAA,WAAA;AAAa,IAAA,aAAA;AAAe,IAAA,gBAAA;AAAkB,IAAA;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconReference.d.ts","sourceRoot":"","sources":["../../../icons/IconReference.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,aAAa;IAK1B,OAAO,EAAE,MAAM,CAAC;IAMhB,GAAG,EAAE,MAAM,CAAC;IAKZ,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,0BAA0B,EAAE,CAAC,MAAM,aAAa,CAAC,EAAkC,CAAC"}
@@ -0,0 +1,21 @@
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 persisted, renderer-neutral identity of one icon: which icon library it comes from, which icon
5
+ * inside that library, and optionally which style variant of it.
6
+ *
7
+ * This is the only form in which a screen, template, blueprint or profile refers to an icon. It carries
8
+ * no CSS class, no SVG and no component - those belong to a renderer's adapter for the library - so the
9
+ * same reference renders on the web, on a phone, or anywhere else a library has an adapter.
10
+ *
11
+ * Identity is all three fields. A display name, a catalog position or a CSS class is never identity:
12
+ * two libraries can each ship an icon called `home`, and `{ library: 'a', key: 'home' }` and
13
+ * `{ library: 'b', key: 'home' }` are different icons that are never silently swapped for one another.
14
+ */ const IconReferencePropertyNames = [
15
+ 'library',
16
+ 'key',
17
+ 'variant'
18
+ ];
19
+
20
+ export { IconReferencePropertyNames };
21
+ //# sourceMappingURL=IconReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconReference.js","sources":["../../../icons/IconReference.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 persisted, renderer-neutral identity of one icon: which icon library it comes from, which icon\n * inside that library, and optionally which style variant of it.\n *\n * This is the only form in which a screen, template, blueprint or profile refers to an icon. It carries\n * no CSS class, no SVG and no component - those belong to a renderer's adapter for the library - so the\n * same reference renders on the web, on a phone, or anywhere else a library has an adapter.\n *\n * Identity is all three fields. A display name, a catalog position or a CSS class is never identity:\n * two libraries can each ship an icon called `home`, and `{ library: 'a', key: 'home' }` and\n * `{ library: 'b', key: 'home' }` are different icons that are never silently swapped for one another.\n */\nexport interface IconReference {\n /**\n * The identity of the icon library - the `name` of the {@link ScenePackage} of kind\n * {@link PackageKind.IconLibrary} that provides the icon.\n */\n library: string;\n\n /**\n * The stable key of the icon inside its library. Stable means a library keeps the key across\n * versions for as long as it ships the icon; it is not the icon's display name.\n */\n key: string;\n\n /**\n * The style variant (`outline`, `solid`, `filled` ...), or absent for a library or icon that has none.\n */\n variant?: string;\n}\n\nexport const IconReferencePropertyNames: (keyof IconReference)[] = ['library', 'key', 'variant'];\n"],"names":["IconReferencePropertyNames"],"mappings":"AAAA;AACA;AAEA;;;;;;;;;;;UA+BaA,0BAAAA,GAAsD;AAAC,IAAA,SAAA;AAAW,IAAA,KAAA;AAAO,IAAA;;;"}
@@ -0,0 +1,6 @@
1
+ import { IconReference } from './IconReference';
2
+ export declare function isIconReference(value: unknown): value is IconReference;
3
+ export declare function iconReferencesEqual(left: IconReference, right: IconReference): boolean;
4
+ export declare function formatIconReference(reference: IconReference): string;
5
+ export declare function parseIconReference(text: string): IconReference | undefined;
6
+ //# sourceMappingURL=iconReferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconReferences.d.ts","sourceRoot":"","sources":["../../../icons/iconReferences.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiBhD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAItE;AAMD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAEtF;AASD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAQpE;AAOD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAK1E"}