@cratis/scene.model 4.3.0 → 4.4.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
@@ -0,0 +1,56 @@
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 character that separates the parts of an icon reference's text form. A reference's parts therefore
5
+ * cannot contain it - an npm package name, an icon key and a variant name never do.
6
+ */ const separator = '#';
7
+ function isPart(value) {
8
+ return typeof value === 'string' && value.length > 0 && !value.includes(separator);
9
+ }
10
+ /**
11
+ * Whether a value is a well-formed {@link IconReference}: a library and a key that are non-empty, an
12
+ * optional non-empty variant, none of them containing the text-form separator. Extra properties are
13
+ * tolerated, because a reference read from a persisted document may carry editor-added metadata.
14
+ */ function isIconReference(value) {
15
+ if (typeof value !== 'object' || value === null) return false;
16
+ const candidate = value;
17
+ return isPart(candidate.library) && isPart(candidate.key) && (candidate.variant === undefined || isPart(candidate.variant));
18
+ }
19
+ /**
20
+ * Whether two references name the same icon. Equality is all three fields - library, key and variant -
21
+ * and nothing else; an absent variant equals only another absent variant.
22
+ */ function iconReferencesEqual(left, right) {
23
+ return left.library === right.library && left.key === right.key && (left.variant ?? undefined) === (right.variant ?? undefined);
24
+ }
25
+ /**
26
+ * The canonical single-string form of a reference, for keys, logs and diagnostics:
27
+ * `library#key`, or `library#key#variant`. Two references are equal exactly when their text forms are equal.
28
+ * It is a convenience for people and tools, not the persisted shape - persist the {@link IconReference}.
29
+ *
30
+ * @throws Error when a part is empty or contains `#`.
31
+ */ function formatIconReference(reference) {
32
+ if (!isIconReference(reference)) {
33
+ 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}'`);
34
+ }
35
+ return reference.variant === undefined ? `${reference.library}${separator}${reference.key}` : `${reference.library}${separator}${reference.key}${separator}${reference.variant}`;
36
+ }
37
+ /**
38
+ * Reads the text form produced by {@link formatIconReference}. Returns `undefined` for anything that is
39
+ * not one - including a bare legacy icon name such as `pi pi-home`, which has no library and so cannot be
40
+ * made into a reference without choosing one.
41
+ */ function parseIconReference(text) {
42
+ const parts = text.split(separator);
43
+ if (parts.length < 2 || parts.length > 3 || !parts.every(isPart)) return undefined;
44
+ const [library, key, variant] = parts;
45
+ return variant === undefined ? {
46
+ library,
47
+ key
48
+ } : {
49
+ library,
50
+ key,
51
+ variant
52
+ };
53
+ }
54
+
55
+ export { formatIconReference, iconReferencesEqual, isIconReference, parseIconReference };
56
+ //# 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;;"}
@@ -0,0 +1,5 @@
1
+ export * from './IconReference';
2
+ export * from './iconReferences';
3
+ export * from './IconLibrary';
4
+ export * from './IconEntry';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../icons/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './IconReference';
2
+ export * from './iconReferences';
3
+ export * from './IconLibrary';
4
+ export * from './IconEntry';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../icons/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -5,6 +5,7 @@ export * from './layouts';
5
5
  export * from './forms';
6
6
  export * from './contributionPoints';
7
7
  export * from './profiles';
8
+ export * from './icons';
8
9
  export * from './packages';
9
10
  export * from './interactions';
10
11
  export * from './screens';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
package/dist/esm/index.js CHANGED
@@ -9,7 +9,6 @@ export { Orientation } from './common/Orientation.js';
9
9
  export { Dock } from './common/Dock.js';
10
10
  export { GridUnitType } from './common/GridUnitType.js';
11
11
  export { GridLengthPropertyNames } from './common/GridLength.js';
12
- export { IconReferencePropertyNames } from './common/IconReference.js';
13
12
  export { DestinationReferencePropertyNames } from './common/DestinationReference.js';
14
13
  export { WidthSizeClass } from './sizeClasses/WidthSizeClass.js';
15
14
  export { HeightSizeClass } from './sizeClasses/HeightSizeClass.js';
@@ -57,6 +56,10 @@ export { ContributionPropertyNames } from './contributionPoints/Contribution.js'
57
56
  export { NavigationItemPropertyNames } from './contributionPoints/NavigationItem.js';
58
57
  export { UiProfilePropertyNames } from './profiles/UiProfile.js';
59
58
  export { ThemePropertyNames } from './profiles/Theme.js';
59
+ export { IconReferencePropertyNames } from './icons/IconReference.js';
60
+ export { formatIconReference, iconReferencesEqual, isIconReference, parseIconReference } from './icons/iconReferences.js';
61
+ export { IconLibraryPropertyNames } from './icons/IconLibrary.js';
62
+ export { IconEntryPropertyNames } from './icons/IconEntry.js';
60
63
  export { PackageKind } from './packages/PackageKind.js';
61
64
  export { PackageDependencyPropertyNames } from './packages/PackageDependency.js';
62
65
  export { ScenePackagePropertyNames } from './packages/ScenePackage.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  export declare enum PackageKind {
2
2
  ComponentLibrary = "ComponentLibrary",
3
3
  Styling = "Styling",
4
- Blueprint = "Blueprint"
4
+ Blueprint = "Blueprint",
5
+ IconLibrary = "IconLibrary"
5
6
  }
6
7
  //# sourceMappingURL=PackageKind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackageKind.d.ts","sourceRoot":"","sources":["../../../packages/PackageKind.ts"],"names":[],"mappings":"AAQA,oBAAY,WAAW;IAMnB,gBAAgB,qBAAqB;IAOrC,OAAO,YAAY;IAYnB,SAAS,cAAc;CAC1B"}
1
+ {"version":3,"file":"PackageKind.d.ts","sourceRoot":"","sources":["../../../packages/PackageKind.ts"],"names":[],"mappings":"AAQA,oBAAY,WAAW;IAMnB,gBAAgB,qBAAqB;IAOrC,OAAO,YAAY;IAYnB,SAAS,cAAc;IAavB,WAAW,gBAAgB;CAC9B"}
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
  /**
4
4
  * What a {@link ScenePackage} contributes to a {@link UiProfile}. A profile's package list mixes all
5
- * three kinds freely - the kind says what a package is for, never where it sits in the override-priority
5
+ * four kinds freely - the kind says what a package is for, never where it sits in the override-priority
6
6
  * order.
7
7
  */ var PackageKind = /*#__PURE__*/ function(PackageKind) {
8
8
  /**
@@ -25,6 +25,17 @@
25
25
  * against PrimeReact and Cratis Components, and says so. That is what makes "which blueprints can I
26
26
  * use" answerable from the packages a profile already has.
27
27
  */ PackageKind["Blueprint"] = "Blueprint";
28
+ /**
29
+ * Provides icons - a named, versioned library of them, such as Lucide or PrimeIcons - that screens,
30
+ * templates and blueprints refer to by {@link IconReference} rather than by CSS class or markup.
31
+ * A library declares its variants, renderer adapters and attribution through
32
+ * {@link ScenePackage.iconLibrary}; its icon catalog is loaded on demand, never listed in the package.
33
+ *
34
+ * It is a package kind rather than a contribution on another kind because everything an author asks
35
+ * of a library - select it in a profile, see its license and version, have it pulled in by the
36
+ * components that need it - is already what a package is. Several libraries coexist in one profile,
37
+ * and the library is part of every icon's identity, so same-named icons never shadow one another.
38
+ */ PackageKind["IconLibrary"] = "IconLibrary";
28
39
  return PackageKind;
29
40
  }({});
30
41
 
@@ -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;;"}
@@ -1,3 +1,4 @@
1
+ import { IconLibrary } from '../icons';
1
2
  import { PackageDependency } from './PackageDependency';
2
3
  import { PackageKind } from './PackageKind';
3
4
  export interface ScenePackage {
@@ -15,6 +16,7 @@ export interface ScenePackage {
15
16
  module?: string;
16
17
  license?: string;
17
18
  licenseUrl?: string;
19
+ iconLibrary?: IconLibrary;
18
20
  }
19
21
  export declare const ScenePackagePropertyNames: (keyof ScenePackage)[];
20
22
  //# sourceMappingURL=ScenePackage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScenePackage.d.ts","sourceRoot":"","sources":["../../../packages/ScenePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,MAAM,WAAW,YAAY;IAIzB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC;IAKhB,IAAI,EAAE,WAAW,CAAC;IAKlB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAKlC,UAAU,EAAE,MAAM,EAAE,CAAC;IAMrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAMlB,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,MAAM,EAAE,MAAM,EAAE,CAAC;IAKjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAOhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAOjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,yBAAyB,EAAE,CAAC,MAAM,YAAY,CAAC,EAe3D,CAAC"}
1
+ {"version":3,"file":"ScenePackage.d.ts","sourceRoot":"","sources":["../../../packages/ScenePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,MAAM,WAAW,YAAY;IAIzB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC;IAKhB,IAAI,EAAE,WAAW,CAAC;IAKlB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAKlC,UAAU,EAAE,MAAM,EAAE,CAAC;IAMrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAMlB,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,MAAM,EAAE,MAAM,EAAE,CAAC;IAKjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAOhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAOjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,yBAAyB,EAAE,CAAC,MAAM,YAAY,CAAC,EAgB3D,CAAC"}
@@ -14,7 +14,8 @@ const ScenePackagePropertyNames = [
14
14
  'description',
15
15
  'module',
16
16
  'license',
17
- 'licenseUrl'
17
+ 'licenseUrl',
18
+ 'iconLibrary'
18
19
  ];
19
20
 
20
21
  export { 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;;;"}