@o3r/components 10.2.0-prerelease.9 → 10.2.0-rc.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 (52) hide show
  1. package/README.md +3 -0
  2. package/builders/component-extractor/helpers/component/component-class.extractor.js.map +1 -0
  3. package/builders/component-extractor/helpers/component/component-config.extractor.js.map +1 -0
  4. package/builders/component-extractor/helpers/component/component.extractor.js.map +1 -0
  5. package/builders/component-extractor/helpers/component/component.parser.js.map +1 -0
  6. package/builders/component-extractor/helpers/component/index.js.map +1 -0
  7. package/builders/component-extractor/helpers/index.js.map +1 -0
  8. package/builders/component-extractor/index.js.map +1 -0
  9. package/builders/component-extractor/schema.js.map +1 -0
  10. package/devkit/components-devkit.interface.d.ts +16 -1
  11. package/devkit/components-devkit.interface.d.ts.map +1 -1
  12. package/devkit/components-devtools.message.service.d.ts +1 -0
  13. package/devkit/components-devtools.message.service.d.ts.map +1 -1
  14. package/esm2022/devkit/components-devkit.interface.mjs +2 -1
  15. package/esm2022/devkit/components-devtools.message.service.mjs +16 -5
  16. package/esm2022/devkit/components-devtools.module.mjs +4 -4
  17. package/esm2022/rules-engine/placeholder.action-handler.mjs +3 -3
  18. package/esm2022/rules-engine/placeholder.rules-engine.effect.mjs +22 -13
  19. package/esm2022/rules-engine/placeholder.rules-engine.module.mjs +4 -4
  20. package/esm2022/stores/placeholder-request/placeholder-request.module.mjs +4 -4
  21. package/esm2022/stores/placeholder-request/placeholder-request.state.mjs +1 -1
  22. package/esm2022/stores/placeholder-template/placeholder-template.module.mjs +4 -4
  23. package/esm2022/tools/component-replacement/c11n.directive.mjs +3 -3
  24. package/esm2022/tools/component-replacement/c11n.mock.module.mjs +10 -10
  25. package/esm2022/tools/component-replacement/c11n.module.mjs +4 -4
  26. package/esm2022/tools/component-replacement/c11n.service.mjs +3 -3
  27. package/esm2022/tools/pipes/capitalize/capitalize.module.mjs +4 -4
  28. package/esm2022/tools/pipes/capitalize/capitalize.pipe.mjs +6 -6
  29. package/esm2022/tools/pipes/duration/duration.module.mjs +4 -4
  30. package/esm2022/tools/pipes/duration/duration.pipe.mjs +6 -6
  31. package/esm2022/tools/pipes/keep-white-space/keep-white-space.module.mjs +4 -4
  32. package/esm2022/tools/pipes/keep-white-space/keep-white-space.pipe.mjs +6 -6
  33. package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.module.mjs +4 -4
  34. package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.pipe.mjs +6 -6
  35. package/esm2022/tools/placeholder/placeholder.component.mjs +3 -3
  36. package/esm2022/tools/placeholder/placeholder.module.mjs +4 -4
  37. package/fesm2022/o3r-components-rules-engine.mjs +28 -19
  38. package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
  39. package/fesm2022/o3r-components.mjs +95 -83
  40. package/fesm2022/o3r-components.mjs.map +1 -1
  41. package/package.json +26 -25
  42. package/rules-engine/placeholder.rules-engine.effect.d.ts.map +1 -1
  43. package/schemas/placeholder-template.schema.json +8 -0
  44. package/schematics/cms-adapter/index.js.map +1 -0
  45. package/schematics/ng-add/helpers/devtools-registration.js.map +1 -0
  46. package/schematics/ng-add/index.d.ts.map +1 -1
  47. package/schematics/ng-add/index.js +56 -57
  48. package/schematics/ng-add/index.js.map +1 -0
  49. package/schematics/ng-add/schema.js.map +1 -0
  50. package/schematics/ng-update/v10-0/index.js.map +1 -0
  51. package/stores/placeholder-request/placeholder-request.state.d.ts +1 -0
  52. package/stores/placeholder-request/placeholder-request.state.d.ts.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/components",
3
- "version": "10.2.0-prerelease.9",
3
+ "version": "10.2.0-rc.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,12 +12,13 @@
12
12
  "otter-cms"
13
13
  ],
14
14
  "exports": {
15
- "./schemas/*.json": {
16
- "default": "./schemas/*.json"
17
- },
18
15
  "./package.json": {
16
+ "node": "./package.json",
19
17
  "default": "./package.json"
20
18
  },
19
+ "./schemas/*.json": {
20
+ "default": "./schemas/*.json"
21
+ },
21
22
  ".": {
22
23
  "types": "./index.d.ts",
23
24
  "esm2022": "./esm2022/o3r-components.mjs",
@@ -32,33 +33,33 @@
32
33
  }
33
34
  },
34
35
  "peerDependencies": {
35
- "@angular-devkit/architect": "~0.1702.0",
36
- "@angular-devkit/schematics": "~17.2.0",
37
- "@angular/cdk": "~17.2.0",
38
- "@angular/common": "~17.2.0",
39
- "@angular/core": "~17.2.0",
40
- "@angular/forms": "~17.2.0",
41
- "@angular/platform-browser": "~17.2.0",
42
- "@angular/platform-browser-dynamic": "~17.2.0",
36
+ "@angular-devkit/architect": "~0.1703.0",
37
+ "@angular-devkit/schematics": "~17.3.0",
38
+ "@angular/cdk": "~17.3.0",
39
+ "@angular/common": "~17.3.0",
40
+ "@angular/core": "~17.3.0",
41
+ "@angular/forms": "~17.3.0",
42
+ "@angular/platform-browser": "~17.3.0",
43
+ "@angular/platform-browser-dynamic": "~17.3.0",
43
44
  "@ngrx/effects": "~17.1.0",
44
45
  "@ngrx/entity": "~17.1.0",
45
46
  "@ngrx/store": "~17.1.0",
46
- "@o3r/analytics": "^10.2.0-prerelease.9",
47
- "@o3r/configuration": "^10.2.0-prerelease.9",
48
- "@o3r/core": "^10.2.0-prerelease.9",
49
- "@o3r/dynamic-content": "^10.2.0-prerelease.9",
50
- "@o3r/extractors": "^10.2.0-prerelease.9",
51
- "@o3r/localization": "^10.2.0-prerelease.9",
52
- "@o3r/logger": "^10.2.0-prerelease.9",
53
- "@o3r/rules-engine": "^10.2.0-prerelease.9",
54
- "@o3r/schematics": "^10.2.0-prerelease.9",
55
- "@o3r/testing": "^10.2.0-prerelease.9",
56
- "@schematics/angular": "~17.2.0",
47
+ "@o3r/analytics": "^10.2.0-rc.0",
48
+ "@o3r/configuration": "^10.2.0-rc.0",
49
+ "@o3r/core": "^10.2.0-rc.0",
50
+ "@o3r/dynamic-content": "^10.2.0-rc.0",
51
+ "@o3r/extractors": "^10.2.0-rc.0",
52
+ "@o3r/localization": "^10.2.0-rc.0",
53
+ "@o3r/logger": "^10.2.0-rc.0",
54
+ "@o3r/rules-engine": "^10.2.0-rc.0",
55
+ "@o3r/schematics": "^10.2.0-rc.0",
56
+ "@o3r/testing": "^10.2.0-rc.0",
57
+ "@schematics/angular": "~17.3.0",
57
58
  "chokidar": "^3.5.2",
58
59
  "globby": "^11.1.0",
59
60
  "jsonpath-plus": "^8.0.0",
60
61
  "rxjs": "^7.8.1",
61
- "typescript": "~5.3.3"
62
+ "typescript": "~5.4.2"
62
63
  },
63
64
  "peerDependenciesMeta": {
64
65
  "@angular-devkit/schematics": {
@@ -105,7 +106,7 @@
105
106
  }
106
107
  },
107
108
  "dependencies": {
108
- "tslib": "^2.5.3"
109
+ "tslib": "^2.6.2"
109
110
  },
110
111
  "engines": {
111
112
  "node": ">=18.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder.rules-engine.effect.d.ts","sourceRoot":"","sources":["../../src/rules-engine/placeholder.rules-engine.effect.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAuB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAGL,uBAAuB,EAKxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,wBAAwB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAuB,UAAU,EAAK,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;;AAGlC;;GAEG;AACH,qBACa,iCAAiC;IAoD1C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACV,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,qB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AAqB,EAAE,qBAAqB,GAAG,IAAI,EACnD,kBAAkB,EAAE,mBAAmB,GAAG,IAAI;IAG7E;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;yCAlEb,iCAAiC;6CAAjC,iCAAiC;CA0I7C"}
@@ -41,10 +41,18 @@
41
41
  "type": "string"
42
42
  },
43
43
  "vars": {
44
+ "deprecated": true,
45
+ "description": "Deprecated: will be removed in V12. List of variables that can be used in the localization string",
44
46
  "type": "array",
45
47
  "items": {
46
48
  "type": "string"
47
49
  }
50
+ },
51
+ "parameters": {
52
+ "type": "object",
53
+ "additionalProperties": {
54
+ "type": "string"
55
+ }
48
56
  }
49
57
  }
50
58
  },
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/cms-adapter/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAuF;AACvF,gDAAsI;AACtI,wDAAkC;AAElC;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,OAA6C;IACvE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,OAAO,iBAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,MAAM,eAAe,GAAG,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAChE,MAAM,SAAS,GAAG,IAAA,+BAAkB,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpG,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAChC,gBAAgB,CAAC,SAAS,GAAG,EAAE,CAAC;QAClC,C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AAW,CAAC,OAAO,CAAC;aAC5E,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,oBAAoB,IAAI,CAAC,EAAE,CAAC;aAC1C,IAAI,CAAC,MAAM,CAAC,CAAC;QAEhB,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,IAAI,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9F,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,IAAA,kBAAK,EAAC;QACX,oBAAoB;QACpB,eAAe;KAChB,CAAC,CAAC;AACL,CAAC;AAGD;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAA,kDAAqC,EAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":";;;;AACA,wDAAkC;AAGlC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,MAAM,oBAAoB,GAAG,kCAAkC,CAAC;AAChE,MAAM,YAAY,GAAW,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;AAErG;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAA8B,EAAiB,EAAE;IACtF,MAAM,EAAE,6BAA6B,EAAE,GAAG,gEAAa,iBAAiB,GAAC,CAAC;IAC1E,OAAO,6BAA6B,CAAC;QACnC,UAAU,EAAE,mBAAmB;QAC/B,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,oBAAoB;QACjC,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA+EtD;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAIjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA+EtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const schematics_1 = require("@angular-devkit/schematics");
6
- const schematics_2 = require("@o3r/schematics");
7
6
  const path = tslib_1.__importStar(require("node:path"));
8
7
  const fs = tslib_1.__importStar(require("node:fs"));
9
8
  const cms_adapter_1 = require("../cms-adapter");
10
9
  const devtools_registration_1 = require("./helpers/devtools-registration");
11
- const schematics_3 = require("@o3r/schematics");
10
+ const reportMissingSchematicsDep = (logger) => (reason) => {
11
+ logger.error(`[ERROR]: Adding @o3r/components has failed.
12
+ If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the components package. Please run 'ng add @o3r/core' .
13
+ Otherwise, use the error message as guidance.`);
14
+ throw reason;
15
+ };
12
16
  /**
13
17
  * Add Otter components to an Angular Project
14
18
  * @param options
@@ -16,66 +20,61 @@ const schematics_3 = require("@o3r/schematics");
16
20
  function ngAddFn(options) {
17
21
  /* ng add rules */
18
22
  return async (tree, context) => {
19
- try {
20
- const { getDefaultOptionsForSchematic, getO3rPeerDeps, getProjectNewDependenciesTypes, getWorkspaceConfig, setupDependencies, removePackages, registerPackageCollectionSchematics } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics')));
21
- // eslint-disable-next-line @typescript-eslint/naming-convention
22
- const { NodeDependencyType } = await Promise.resolve().then(() => tslib_1.__importStar(require('@schematics/angular/utility/dependencies')));
23
- options = { ...getDefaultOptionsForSchematic(getWorkspaceConfig(tree), '@o3r/components', 'ng-add', options), ...options };
24
- const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
25
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
26
- const depsInfo = getO3rPeerDeps(packageJsonPath);
27
- if (options.enableMetadataExtract) {
28
- depsInfo.o3rPeerDeps = [...depsInfo.o3rPeerDeps, '@o3r/extractors'];
29
- }
30
- const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
31
- const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
32
- acc[dep] = {
33
- inManifest: [{
34
- range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
35
- types: getProjectNewDependenciesTypes(workspaceProject)
36
- }],
37
- ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
38
- };
39
- return acc;
40
- }, (0, schematics_3.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
41
- const devDependencies = {
42
- chokidar: {
43
- inManifest: [{
44
- range: packageJson.peerDependencies.chokidar,
45
- types: [NodeDependencyType.Dev]
46
- }]
47
- }
48
- };
49
- const rule = (0, schematics_1.chain)([
50
- removePackages(['@otter/components']),
51
- setupDependencies({
52
- projectName: options.projectName,
53
- dependencies: {
54
- ...dependencies,
55
- ...devDependencies
56
- },
57
- ngAddToRun: depsInfo.o3rPeerDeps
58
- }),
59
- registerPackageCollectionSchematics(packageJson),
60
- ...(options.enableMetadataExtract ? [(0, cms_adapter_1.updateCmsAdapter)(options)] : []),
61
- await (0, devtools_registration_1.registerDevtools)(options)
62
- ]);
63
- context.logger.info(`The package ${depsInfo.packageName} comes with a debug mechanism`);
64
- context.logger.info('Get more information on the following page: https://github.com/AmadeusITGroup/otter/tree/main/docs/components/COMPONENT_STRUCTURE.md#Runtime-debugging');
65
- return () => rule(tree, context);
66
- }
67
- catch (e) {
68
- // components needs o3r/core as peer dep. o3r/core will install o3r/schematics
69
- context.logger.error(`[ERROR]: Adding @o3r/components has failed.
70
- If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the components package. Please run 'ng add @o3r/core' .
71
- Otherwise, use the error message as guidance.`);
72
- throw (e);
23
+ const { getDefaultOptionsForSchematic, getO3rPeerDeps, getProjectNewDependenciesTypes, getWorkspaceConfig, setupDependencies, removePackages, registerPackageCollectionSchematics, getPackageInstallConfig } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics')));
24
+ // eslint-disable-next-line @typescript-eslint/naming-convention
25
+ const { NodeDependencyType } = await Promise.resolve().then(() => tslib_1.__importStar(require('@schematics/angular/utility/dependencies')));
26
+ options = { ...getDefaultOptionsForSchematic(getWorkspaceConfig(tree), '@o3r/components', 'ng-add', options), ...options };
27
+ const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
28
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
29
+ const depsInfo = getO3rPeerDeps(packageJsonPath);
30
+ if (options.enableMetadataExtract) {
31
+ depsInfo.o3rPeerDeps = [...depsInfo.o3rPeerDeps, '@o3r/extractors'];
73
32
  }
33
+ const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
34
+ const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
35
+ acc[dep] = {
36
+ inManifest: [{
37
+ range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
38
+ types: getProjectNewDependenciesTypes(workspaceProject)
39
+ }],
40
+ ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
41
+ };
42
+ return acc;
43
+ }, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
44
+ const devDependencies = {
45
+ chokidar: {
46
+ inManifest: [{
47
+ range: packageJson.peerDependencies.chokidar,
48
+ types: [NodeDependencyType.Dev]
49
+ }]
50
+ }
51
+ };
52
+ const rule = (0, schematics_1.chain)([
53
+ removePackages(['@otter/components']),
54
+ setupDependencies({
55
+ projectName: options.projectName,
56
+ dependencies: {
57
+ ...dependencies,
58
+ ...devDependencies
59
+ },
60
+ ngAddToRun: depsInfo.o3rPeerDeps
61
+ }),
62
+ registerPackageCollectionSchematics(packageJson),
63
+ ...(options.enableMetadataExtract ? [(0, cms_adapter_1.updateCmsAdapter)(options)] : []),
64
+ await (0, devtools_registration_1.registerDevtools)(options)
65
+ ]);
66
+ context.logger.info(`The package ${depsInfo.packageName} comes with a debug mechanism`);
67
+ context.logger.info('Get more information on the following page: https://github.com/AmadeusITGroup/otter/tree/main/docs/components/COMPONENT_STRUCTURE.md#Runtime-debugging');
68
+ return () => rule(tree, context);
74
69
  };
75
70
  }
76
71
  /**
77
72
  * Add Otter components to an Angular Project
78
73
  * @param options
79
74
  */
80
- exports.ngAdd = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddFn);
75
+ const ngAdd = (options) => async (_, { logger }) => {
76
+ const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => tslib_1.__importStar(require('@o3r/schematics'))).catch(reportMissingSchematicsDep(logger));
77
+ return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
78
+ };
79
+ exports.ngAdd = ngAdd;
81
80
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAiF;AACjF,wDAAkC;AAClC,oDAA8B;AAC9B,gDAAkD;AAElD,2EAAmE;A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AAC,EAAE,CAAC;YACrE,MAAM,IAAA,wCAAgB,EAAC,OAAO,CAAC;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,QAAQ,CAAC,WAAY,+BAA+B,CAAC,CAAC;QACzF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wJAAwJ,CAAC,CAAC;QAE9K,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,MAAM,KAAK,GAAG,CAAC,OAA8B,EAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACrF,MAAM,EAAE,qCAAqC,EAAE,GAAG,MAAM,0DAAO,iBAAiB,IAAE,KAAK,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5H,OAAO,qCAAqC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC,CAAC;AAHW,QAAA,KAAK,SAGhB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/ng-update/v10-0/index.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,2DAAuF;AACvF,gDAA2I;AAE3I,MAAM,mBAAmB,GAAwB;IAC/C,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,mBAAmB;SAC5B;QACD,MAAM,EAAE,sBAAsB;KAC/B;IACD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,iBAAiB;SAC1B;QACD,MAAM,EAAE,oBAAoB;KAC7B;IACD,cAAc,EAAE;QACd,GAAG,EAAE;Y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AAO,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACU,QAAA,WAAW,GAAG,IAAA,kDAAqC,EAAC,aAAa,CAAC,CAAC"}
@@ -7,6 +7,7 @@ export interface PlaceholderVariable {
7
7
  type: 'fact' | 'fullUrl' | 'relativeUrl' | 'localisation';
8
8
  value: string;
9
9
  vars?: string[];
10
+ parameters?: Record<string, string>;
10
11
  path?: string;
11
12
  }
12
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder-request.state.d.ts","sourceRoot":"","sources":["../../../src/stores/placeholder-request/placeholder-request.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,cAAc,EAAE,uBAAuB;IACtF,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,8IAA8I;IAC9I,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,cAAc;CAAG;AAEzE;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW,CAAC,uBAAuB,CAAC,EAAE,8BAA8B;CACpH;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,+BAA+B;IAC/B,CAAC,8BAA8B,CAAC,EAAE,uBAAuB,CAAC;CAC3D"}
1
+ {"version":3,"file":"placeholder-request.state.d.ts","sourceRoot":"","sources":["../../../src/stores/placeholder-request/placeholder-request.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,cAAc,EAAE,uBAAuB;IACtF,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,8IAA8I;IA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