@uniformdev/transformer 1.1.49 → 1.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -136,6 +136,7 @@ interface AddComponentPatternOptions extends GlobalOptions {
136
136
  parentComponentType: string;
137
137
  slot: string;
138
138
  componentPatternId: string;
139
+ compositionIds?: string;
139
140
  }
140
141
  interface PropagateRootComponentSlotOptions extends GlobalOptions {
141
142
  compositionType: string;
@@ -198,6 +199,11 @@ interface SplitContentTypeOptions extends GlobalOptions {
198
199
  fieldId: string;
199
200
  fieldContains: string;
200
201
  }
202
+ interface ClearSlotOptions extends GlobalOptions {
203
+ slot: string;
204
+ parentComponentType?: string;
205
+ compositionIds?: string;
206
+ }
201
207
 
202
208
  declare class TransformError extends Error {
203
209
  constructor(message: string);
@@ -441,6 +447,7 @@ interface AddComponentInternalOptions {
441
447
  newComponentType?: string;
442
448
  componentPatternId?: string;
443
449
  parameters?: string;
450
+ compositionIds?: string[];
444
451
  whatIf: boolean;
445
452
  strict: boolean;
446
453
  }
@@ -638,4 +645,4 @@ declare class FieldRemoverService {
638
645
  private removeKeysFromMap;
639
646
  }
640
647
 
641
- export { type AddComponentOptions, type AddComponentParameterOptions, type AddComponentPatternOptions, type AddContentTypeFieldOptions, ComponentAdderService, ComponentAlreadyExistsError, type ComponentDefinition, type ComponentInstance, ComponentNotFoundError, ComponentRenamerService, ComponentService, type Composition, CompositionConverterService, type CompositionOverrides, type CompositionPatternCandidatesOptions, type CompositionRoot, CompositionService, type ContentTypeDefinition$1 as ContentTypeDefinition, type ContentTypeField$1 as ContentTypeField, type ConvertCompositionsToEntriesOptions, DuplicateIdError, FieldRemoverService, FileNotFoundError, FileSystemService, type FlattenBlockFieldOptions, type GenerateMissingProjectMapNodesOptions, type GlobalOptions, InvalidYamlError, Logger, type PackSerializationOptions, type Parameter, ParameterRemoverService, type ParameterValue, type PropagateRootComponentPropertyOptions, type PropagateRootComponentSlotOptions, type PropagateRootSlotOptions, PropertyNotFoundError, PropertyPropagatorService, type RemoveFieldOptions, type RemoveOrphanEntriesOptions, type RemoveParameterOptions, type RemoveUnusedComponentTypesOptions, type RemoveUnusedContentTypesOptions, type RenameComponentOptions, type RenameSlotOptions, SlotAlreadyExistsError, type SlotDefinition, SlotNotFoundError, SlotRenamerService, type SplitContentTypeOptions, TransformError, type UnpackSerializationOptions, computeGuidHash, regenerateIds };
648
+ export { type AddComponentOptions, type AddComponentParameterOptions, type AddComponentPatternOptions, type AddContentTypeFieldOptions, type ClearSlotOptions, ComponentAdderService, ComponentAlreadyExistsError, type ComponentDefinition, type ComponentInstance, ComponentNotFoundError, ComponentRenamerService, ComponentService, type Composition, CompositionConverterService, type CompositionOverrides, type CompositionPatternCandidatesOptions, type CompositionRoot, CompositionService, type ContentTypeDefinition$1 as ContentTypeDefinition, type ContentTypeField$1 as ContentTypeField, type ConvertCompositionsToEntriesOptions, DuplicateIdError, FieldRemoverService, FileNotFoundError, FileSystemService, type FlattenBlockFieldOptions, type GenerateMissingProjectMapNodesOptions, type GlobalOptions, InvalidYamlError, Logger, type PackSerializationOptions, type Parameter, ParameterRemoverService, type ParameterValue, type PropagateRootComponentPropertyOptions, type PropagateRootComponentSlotOptions, type PropagateRootSlotOptions, PropertyNotFoundError, PropertyPropagatorService, type RemoveFieldOptions, type RemoveOrphanEntriesOptions, type RemoveParameterOptions, type RemoveUnusedComponentTypesOptions, type RemoveUnusedContentTypesOptions, type RenameComponentOptions, type RenameSlotOptions, SlotAlreadyExistsError, type SlotDefinition, SlotNotFoundError, SlotRenamerService, type SplitContentTypeOptions, TransformError, type UnpackSerializationOptions, computeGuidHash, regenerateIds };
package/dist/index.js CHANGED
@@ -2512,6 +2512,7 @@ var ComponentAdderService = class {
2512
2512
  parentComponentType,
2513
2513
  slot,
2514
2514
  componentPatternId,
2515
+ compositionIds,
2515
2516
  whatIf,
2516
2517
  strict
2517
2518
  } = options;
@@ -2605,7 +2606,8 @@ var ComponentAdderService = class {
2605
2606
  newInstance,
2606
2607
  whatIf,
2607
2608
  strict,
2608
- "composition"
2609
+ "composition",
2610
+ compositionIds
2609
2611
  );
2610
2612
  const compositionPatternsResult = await this.addComponentToDirectory(
2611
2613
  fullCompositionPatternsDir,
@@ -2614,7 +2616,8 @@ var ComponentAdderService = class {
2614
2616
  newInstance,
2615
2617
  whatIf,
2616
2618
  strict,
2617
- "compositionPattern"
2619
+ "compositionPattern",
2620
+ compositionIds
2618
2621
  );
2619
2622
  const componentPatternsResult = await this.addComponentToDirectory(
2620
2623
  fullComponentPatternsDir,
@@ -2678,7 +2681,7 @@ var ComponentAdderService = class {
2678
2681
  }
2679
2682
  return raw;
2680
2683
  }
2681
- async addComponentToDirectory(directory, parentTypes, slot, newInstance, whatIf, strict, dirType) {
2684
+ async addComponentToDirectory(directory, parentTypes, slot, newInstance, whatIf, strict, dirType, compositionIds) {
2682
2685
  const exists = await this.fileSystem.fileExists(directory);
2683
2686
  if (!exists) {
2684
2687
  this.logger.detail(`${dirType} directory does not exist, skipping`);
@@ -2710,6 +2713,12 @@ var ComponentAdderService = class {
2710
2713
  continue;
2711
2714
  }
2712
2715
  const rootInstance = composition.composition;
2716
+ if (compositionIds && compositionIds.length > 0) {
2717
+ const compositionId = rootInstance._id;
2718
+ if (!compositionId || !compositionIds.some((id) => this.compareIds(compositionId, id, strict))) {
2719
+ continue;
2720
+ }
2721
+ }
2713
2722
  const rootPath = `${rootInstance._id ?? ""}${rootInstance.type}`;
2714
2723
  let modified = false;
2715
2724
  if (this.matchesAnyParentType(rootInstance.type, parentTypes, strict)) {