@slicemachine/manager 0.24.15-beta.9 → 0.24.16-alpha.coderabbitai-chat-dniAA6r9GseKm4ouqNyJ8dl.1
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/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js +1 -1
- package/dist/_node_modules/cross-spawn/index.cjs +1 -1
- package/dist/_node_modules/cross-spawn/index.js +1 -1
- package/dist/_node_modules/execa/index.cjs +2 -2
- package/dist/_node_modules/execa/index.js +2 -2
- package/dist/_node_modules/npm-run-path/_node_modules/path-key/index.cjs.map +1 -0
- package/dist/_node_modules/npm-run-path/_node_modules/path-key/index.js.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/npm-run-path → npm-run-path}/index.cjs +1 -1
- package/dist/_node_modules/npm-run-path/index.cjs.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/npm-run-path → npm-run-path}/index.js +1 -1
- package/dist/_node_modules/npm-run-path/index.js.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/onetime → onetime}/index.cjs +1 -1
- package/dist/_node_modules/onetime/index.cjs.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/onetime → onetime}/index.js +1 -1
- package/dist/_node_modules/onetime/index.js.map +1 -0
- package/dist/_virtual/index2.cjs +4 -3
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +4 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.cjs +3 -4
- package/dist/_virtual/index3.cjs.map +1 -1
- package/dist/_virtual/index3.js +2 -4
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.cjs +113 -38
- package/dist/managers/customTypes/CustomTypesManager.cjs.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.d.ts +197 -75
- package/dist/managers/customTypes/CustomTypesManager.js +113 -38
- package/dist/managers/customTypes/CustomTypesManager.js.map +1 -1
- package/dist/managers/telemetry/types.cjs +4 -6
- package/dist/managers/telemetry/types.cjs.map +1 -1
- package/dist/managers/telemetry/types.d.ts +6 -7
- package/dist/managers/telemetry/types.js +4 -6
- package/dist/managers/telemetry/types.js.map +1 -1
- package/package.json +4 -4
- package/src/managers/customTypes/CustomTypesManager.ts +261 -74
- package/src/managers/telemetry/types.ts +12 -17
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.js.map +0 -1
- package/dist/_node_modules/execa/_node_modules/onetime/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/onetime/index.js.map +0 -1
- package/dist/_node_modules/execa/_node_modules/path-key/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/path-key/index.js.map +0 -1
- /package/dist/_node_modules/{execa → npm-run-path}/_node_modules/path-key/index.cjs +0 -0
- /package/dist/_node_modules/{execa → npm-run-path}/_node_modules/path-key/index.js +0 -0
@@ -3,6 +3,7 @@ import * as prismicCustomTypesClient from "@prismicio/custom-types-client";
|
|
3
3
|
import {
|
4
4
|
CustomType,
|
5
5
|
Group,
|
6
|
+
LinkConfig,
|
6
7
|
NestableWidget,
|
7
8
|
NestedGroup,
|
8
9
|
SharedSlice,
|
@@ -75,37 +76,60 @@ type SliceMachineManagerUpdateCustomTypeMocksConfigArgs = {
|
|
75
76
|
// TODO
|
76
77
|
mocksConfig: Record<string, unknown>;
|
77
78
|
};
|
78
|
-
|
79
|
+
|
80
|
+
/** `[field]` or `[group, field]` – path INSIDE the Custom Type */
|
81
|
+
type PathWithinCustomType = [string] | [string, string];
|
82
|
+
|
83
|
+
/** `[ct, field]` or `[ct, group, field]` – path WITH Custom Type ID */
|
84
|
+
type PathWithCustomType = [string, string] | [string, string, string];
|
85
|
+
|
86
|
+
type UnprefixedFieldIdChangedMeta = {
|
87
|
+
previousPath: PathWithinCustomType;
|
88
|
+
newPath: PathWithinCustomType;
|
89
|
+
};
|
90
|
+
|
91
|
+
export type SliceMachineManagerUpdateCustomTypeArgs =
|
92
|
+
CustomTypeUpdateHookData & {
|
93
|
+
updateMeta?: {
|
94
|
+
fieldIdChanged?: {
|
95
|
+
/**
|
96
|
+
* Previous path of the changed field. `[field]` or `[group, field]`
|
97
|
+
*/
|
98
|
+
previousPath: PathWithinCustomType;
|
99
|
+
/**
|
100
|
+
* New path of the changed field. `[field]` or `[group, field]`
|
101
|
+
*/
|
102
|
+
newPath: PathWithinCustomType;
|
103
|
+
};
|
104
|
+
};
|
105
|
+
};
|
106
|
+
|
79
107
|
type SliceMachineManagerUpdateCustomTypeMocksConfigArgsReturnType = {
|
80
108
|
errors: HookError[];
|
81
109
|
};
|
82
|
-
|
110
|
+
|
83
111
|
type CustomTypesMachineManagerDeleteCustomTypeArgs = {
|
84
112
|
id: string;
|
85
113
|
};
|
86
|
-
|
114
|
+
|
87
115
|
type CustomTypesMachineManagerDeleteCustomTypeReturnType = {
|
88
116
|
errors: (DecodeError | HookError)[];
|
89
117
|
};
|
90
|
-
|
118
|
+
|
91
119
|
type CustomTypesMachineManagerUpdateCustomTypeReturnType = {
|
92
120
|
errors: (DecodeError | HookError)[];
|
93
121
|
};
|
122
|
+
};
|
123
|
+
|
124
|
+
/** `[ct, field]` or `[ct, group, field]` – path **with** Custom Type ID */
|
125
|
+
type PathWithCustomType = [string, string] | [string, string, string];
|
94
126
|
|
95
127
|
type CustomTypeFieldIdChangedMeta = {
|
96
|
-
previousPath:
|
97
|
-
newPath:
|
128
|
+
previousPath: PathWithCustomType;
|
129
|
+
newPath: PathWithCustomType;
|
98
130
|
};
|
99
131
|
|
100
|
-
type
|
101
|
-
| string
|
102
|
-
| { id: string; fields?: readonly CrCustomTypeNestedCr[] };
|
103
|
-
type CrCustomTypeNestedCr =
|
104
|
-
| string
|
105
|
-
| { id: string; customtypes: readonly CrCustomTypeFieldLeaf[] };
|
106
|
-
type CrCustomTypeFieldLeaf =
|
107
|
-
| string
|
108
|
-
| { id: string; fields?: readonly string[] };
|
132
|
+
type LinkCustomType = NonNullable<LinkConfig["customtypes"]>[number];
|
109
133
|
|
110
134
|
export class CustomTypesManager extends BaseManager {
|
111
135
|
async readCustomTypeLibrary(): Promise<SliceMachineManagerReadCustomTypeLibraryReturnType> {
|
@@ -198,7 +222,9 @@ export class CustomTypesManager extends BaseManager {
|
|
198
222
|
* property.
|
199
223
|
*/
|
200
224
|
private async updateContentRelationships(
|
201
|
-
args: {
|
225
|
+
args: {
|
226
|
+
model: CustomType;
|
227
|
+
} & SliceMachineManagerUpdateCustomTypeFieldIdChanged,
|
202
228
|
): Promise<
|
203
229
|
OnlyHookErrors<CallHookReturnType<CustomTypeUpdateHook>> & {
|
204
230
|
rollback?: () => Promise<void>;
|
@@ -206,12 +232,16 @@ export class CustomTypesManager extends BaseManager {
|
|
206
232
|
> {
|
207
233
|
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
208
234
|
|
209
|
-
const {
|
210
|
-
|
235
|
+
const {
|
236
|
+
model,
|
237
|
+
previousPath: previousFieldPath,
|
238
|
+
newPath: newFieldPath,
|
239
|
+
} = args;
|
211
240
|
|
212
|
-
if (
|
213
|
-
|
214
|
-
|
241
|
+
if (previousFieldPath.join(".") !== newFieldPath.join(".")) {
|
242
|
+
const { id: ctId } = model;
|
243
|
+
const previousPath: PathWithCustomType = [ctId, ...previousFieldPath];
|
244
|
+
const newPath: PathWithCustomType = [ctId, ...newFieldPath];
|
215
245
|
|
216
246
|
const crUpdates: {
|
217
247
|
updatePromise: Promise<{ errors: HookError[] }>;
|
@@ -294,7 +324,7 @@ export class CustomTypesManager extends BaseManager {
|
|
294
324
|
}
|
295
325
|
|
296
326
|
async updateCustomType(
|
297
|
-
args:
|
327
|
+
args: SliceMachineManagerUpdateCustomTypeArgs,
|
298
328
|
): Promise<CustomTypesMachineManagerUpdateCustomTypeReturnType> {
|
299
329
|
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
300
330
|
const { model } = args;
|
@@ -560,99 +590,227 @@ const InferSliceResponse = z.object({
|
|
560
590
|
});
|
561
591
|
|
562
592
|
function updateCRCustomType(
|
563
|
-
args: { customType:
|
564
|
-
):
|
565
|
-
const
|
566
|
-
const
|
593
|
+
args: { customType: LinkCustomType } & CustomTypeFieldIdChangedMeta,
|
594
|
+
): LinkCustomType {
|
595
|
+
const previousPath = getPathIds(args.previousPath);
|
596
|
+
const newPath = getPathIds(args.newPath);
|
567
597
|
|
568
|
-
if (!
|
598
|
+
if (!previousPath.customTypeId || !newPath.customTypeId) {
|
569
599
|
throw new Error(
|
570
|
-
|
600
|
+
`Could not find a customtype id in previousPath (${args.previousPath.join(
|
601
|
+
".",
|
602
|
+
)}) and/or newPath (${args.newPath.join(
|
603
|
+
".",
|
604
|
+
)}), which should not be possible.`,
|
571
605
|
);
|
572
606
|
}
|
573
607
|
|
574
|
-
if (!
|
608
|
+
if (!previousPath.fieldId || !newPath.fieldId) {
|
575
609
|
throw new Error(
|
576
|
-
|
610
|
+
`Could not find a field id in previousPath (${args.previousPath.join(
|
611
|
+
".",
|
612
|
+
)}) and/or newPath (${args.newPath.join(
|
613
|
+
".",
|
614
|
+
)}), which should not be possible.`,
|
577
615
|
);
|
578
616
|
}
|
579
617
|
|
580
618
|
const customType = shallowCloneIfObject(args.customType);
|
581
619
|
|
582
|
-
if (typeof customType === "string"
|
620
|
+
if (typeof customType === "string") {
|
621
|
+
// Legacy format support, we don't have anything to update here.
|
583
622
|
return customType;
|
584
623
|
}
|
585
624
|
|
586
|
-
const matchedCustomTypeId = customType.id ===
|
625
|
+
const matchedCustomTypeId = customType.id === previousPath.customTypeId;
|
626
|
+
|
627
|
+
return {
|
628
|
+
...customType,
|
629
|
+
fields: customType.fields.map((fieldArg) => {
|
630
|
+
const customTypeField = shallowCloneIfObject(fieldArg);
|
631
|
+
|
632
|
+
// Regular field
|
633
|
+
if (typeof customTypeField === "string") {
|
634
|
+
if (
|
635
|
+
matchedCustomTypeId &&
|
636
|
+
customTypeField === previousPath.fieldId &&
|
637
|
+
customTypeField !== newPath.fieldId
|
638
|
+
) {
|
639
|
+
// The id of the field has changed.
|
640
|
+
return newPath.fieldId;
|
641
|
+
}
|
587
642
|
|
588
|
-
|
589
|
-
|
643
|
+
return customTypeField;
|
644
|
+
}
|
590
645
|
|
591
|
-
if (typeof customTypeField === "string") {
|
592
646
|
if (
|
593
647
|
matchedCustomTypeId &&
|
594
|
-
customTypeField ===
|
595
|
-
customTypeField !==
|
648
|
+
customTypeField.id === previousPath.fieldId &&
|
649
|
+
customTypeField.id !== newPath.fieldId
|
596
650
|
) {
|
597
|
-
//
|
598
|
-
//
|
599
|
-
//
|
600
|
-
|
651
|
+
// The id of the field has changed. We don't exit return because there
|
652
|
+
// might be other fields further down in nested custom types or groups
|
653
|
+
// that need to be updated.
|
654
|
+
customTypeField.id = newPath.fieldId;
|
601
655
|
}
|
602
656
|
|
603
|
-
|
604
|
-
|
657
|
+
// Group field
|
658
|
+
if ("fields" in customTypeField) {
|
659
|
+
if (
|
660
|
+
!previousPath.groupId &&
|
661
|
+
!newPath.groupId &&
|
662
|
+
customTypeField.id === previousPath.fieldId &&
|
663
|
+
customTypeField.id !== newPath.fieldId
|
664
|
+
) {
|
665
|
+
// Only the id of the group has changed. Group id is not defined, so
|
666
|
+
// we can return early.
|
667
|
+
return newPath.fieldId;
|
668
|
+
}
|
669
|
+
|
670
|
+
const matchedGroupId = customTypeField.id === previousPath.groupId;
|
671
|
+
|
672
|
+
if (
|
673
|
+
previousPath.groupId &&
|
674
|
+
newPath.groupId &&
|
675
|
+
matchedGroupId &&
|
676
|
+
customTypeField.id !== newPath.groupId
|
677
|
+
) {
|
678
|
+
// The id of the group field has changed, so we update it. We don't
|
679
|
+
// return because there are group fields that may need to be updated.
|
680
|
+
customTypeField.id = newPath.groupId;
|
681
|
+
}
|
682
|
+
|
683
|
+
return {
|
684
|
+
...customTypeField,
|
685
|
+
fields: customTypeField.fields.map((groupFieldArg) => {
|
686
|
+
const groupField = shallowCloneIfObject(groupFieldArg);
|
687
|
+
|
688
|
+
// Regular field inside a group field
|
689
|
+
if (typeof groupField === "string") {
|
690
|
+
if (
|
691
|
+
matchedGroupId &&
|
692
|
+
groupField === previousPath.fieldId &&
|
693
|
+
groupField !== newPath.fieldId
|
694
|
+
) {
|
695
|
+
// The id of the field inside the group has changed.
|
696
|
+
return newPath.fieldId;
|
697
|
+
}
|
698
|
+
|
699
|
+
return groupField;
|
700
|
+
}
|
701
|
+
|
702
|
+
// Content relationship field inside a group field
|
703
|
+
return {
|
704
|
+
...groupField,
|
705
|
+
fields: updateContentRelationshipFields({
|
706
|
+
customtypes: groupField.customtypes,
|
707
|
+
previousPath,
|
708
|
+
newPath,
|
709
|
+
}),
|
710
|
+
};
|
711
|
+
}),
|
712
|
+
};
|
713
|
+
}
|
714
|
+
|
715
|
+
// Content relationship field
|
716
|
+
return {
|
717
|
+
...customTypeField,
|
718
|
+
customtypes: updateContentRelationshipFields({
|
719
|
+
customtypes: customTypeField.customtypes,
|
720
|
+
previousPath,
|
721
|
+
newPath,
|
722
|
+
}),
|
723
|
+
};
|
724
|
+
}),
|
725
|
+
};
|
726
|
+
}
|
727
|
+
|
728
|
+
function updateContentRelationshipFields(args: {
|
729
|
+
customtypes: readonly (
|
730
|
+
| string
|
731
|
+
| {
|
732
|
+
id: string;
|
733
|
+
fields: readonly (string | { id: string; fields: readonly string[] })[];
|
734
|
+
}
|
735
|
+
)[];
|
736
|
+
previousPath: CrUpdatePathIds;
|
737
|
+
newPath: CrUpdatePathIds;
|
738
|
+
}) {
|
739
|
+
const { customtypes, previousPath, newPath } = args;
|
740
|
+
|
741
|
+
return customtypes.map((nestedCtArg) => {
|
742
|
+
const nestedCt = shallowCloneIfObject(nestedCtArg);
|
605
743
|
|
606
744
|
if (
|
607
|
-
|
608
|
-
|
609
|
-
|
745
|
+
typeof nestedCt === "string" ||
|
746
|
+
// Since we are entering a new custom type, if the previous id
|
747
|
+
// doesn't match, we can return early, because it's not the
|
748
|
+
// custom type we are looking for.
|
749
|
+
nestedCt.id !== previousPath.customTypeId
|
610
750
|
) {
|
611
|
-
|
612
|
-
// so we update it new one.
|
613
|
-
// Since field is not a string, we don't exit, as we might have
|
614
|
-
// something to update further down in customtypes.
|
615
|
-
customTypeField.id = newFieldId;
|
751
|
+
return nestedCt;
|
616
752
|
}
|
617
753
|
|
618
754
|
return {
|
619
|
-
...
|
620
|
-
|
621
|
-
const
|
755
|
+
...nestedCt,
|
756
|
+
fields: nestedCt.fields.map((nestedCtFieldArg) => {
|
757
|
+
const nestedCtField = shallowCloneIfObject(nestedCtFieldArg);
|
758
|
+
|
759
|
+
// Regular field
|
760
|
+
if (typeof nestedCtField === "string") {
|
761
|
+
if (
|
762
|
+
nestedCtField === previousPath.fieldId &&
|
763
|
+
nestedCtField !== newPath.fieldId
|
764
|
+
) {
|
765
|
+
// The id of the field has changed.
|
766
|
+
return newPath.fieldId;
|
767
|
+
}
|
768
|
+
|
769
|
+
return nestedCtField;
|
770
|
+
}
|
771
|
+
|
772
|
+
// Group field
|
622
773
|
|
623
774
|
if (
|
624
|
-
|
625
|
-
|
626
|
-
// Since we are on the last level, if we don't start matching right
|
627
|
-
// at the custom type id, we can return exit early because it's not
|
628
|
-
// a match.
|
629
|
-
nestedCustomType.id !== previousCustomTypeId
|
775
|
+
nestedCtField.id === previousPath.fieldId &&
|
776
|
+
nestedCtField.id !== newPath.fieldId
|
630
777
|
) {
|
631
|
-
|
778
|
+
// The id of the field has changed.
|
779
|
+
nestedCtField.id = newPath.fieldId;
|
632
780
|
}
|
633
781
|
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
782
|
+
// Further down the path, the field can only be a group field. So if we have
|
783
|
+
// no group id defined, no need to continue.
|
784
|
+
if (
|
785
|
+
!previousPath.groupId ||
|
786
|
+
!newPath.groupId ||
|
787
|
+
nestedCtField.id !== previousPath.groupId
|
788
|
+
) {
|
789
|
+
return nestedCtField;
|
790
|
+
}
|
638
791
|
|
792
|
+
if (nestedCtField.id !== newPath.groupId) {
|
793
|
+
// The id of the group has changed.
|
794
|
+
nestedCtField.id = newPath.groupId;
|
795
|
+
}
|
796
|
+
|
797
|
+
return {
|
798
|
+
...nestedCtField,
|
799
|
+
fields: nestedCtField.fields.map((nestedCtGroupFieldId) => {
|
639
800
|
if (
|
640
|
-
|
641
|
-
|
801
|
+
nestedCtGroupFieldId === previousPath.fieldId &&
|
802
|
+
nestedCtGroupFieldId !== newPath.fieldId
|
642
803
|
) {
|
643
|
-
//
|
644
|
-
|
645
|
-
return newFieldId;
|
804
|
+
// The id of the field inside the group has changed.
|
805
|
+
return newPath.fieldId;
|
646
806
|
}
|
647
807
|
|
648
|
-
return
|
808
|
+
return nestedCtGroupFieldId;
|
649
809
|
}),
|
650
810
|
};
|
651
811
|
}),
|
652
812
|
};
|
653
813
|
});
|
654
|
-
|
655
|
-
return { ...customType, fields: newFields };
|
656
814
|
}
|
657
815
|
|
658
816
|
/**
|
@@ -721,7 +879,7 @@ export function updateSharedSliceContentRelationships(
|
|
721
879
|
|
722
880
|
for (const { model: slice } of models) {
|
723
881
|
const updateSlice = traverseSharedSlice({
|
724
|
-
path: [
|
882
|
+
path: [],
|
725
883
|
slice,
|
726
884
|
onField: ({ field }) => {
|
727
885
|
return updateFieldContentRelationships({
|
@@ -738,6 +896,35 @@ export function updateSharedSliceContentRelationships(
|
|
738
896
|
}
|
739
897
|
}
|
740
898
|
|
899
|
+
interface CrUpdatePathIds {
|
900
|
+
customTypeId: string;
|
901
|
+
groupId: string | undefined;
|
902
|
+
fieldId: string;
|
903
|
+
}
|
904
|
+
|
905
|
+
function getPathIds(path: PathWithCustomType): CrUpdatePathIds {
|
906
|
+
if (path.length < 2) {
|
907
|
+
throw new Error(
|
908
|
+
`Unexpected path length ${
|
909
|
+
path.length
|
910
|
+
}. Expected at least 2 segments (got: ${path.join(".")}).`,
|
911
|
+
);
|
912
|
+
}
|
913
|
+
|
914
|
+
const [customTypeId, groupOrFieldId, fieldId] = path;
|
915
|
+
|
916
|
+
return {
|
917
|
+
customTypeId,
|
918
|
+
/**
|
919
|
+
* Id of a changed group. If it's defined, it means that a group or a field
|
920
|
+
* inside a group had its API ID renamed. It's defined when the path has a
|
921
|
+
* third element (e.g. `["customtypeA", "groupA", "fieldA"]`).
|
922
|
+
*/
|
923
|
+
groupId: fieldId ? groupOrFieldId : undefined,
|
924
|
+
fieldId: fieldId || groupOrFieldId,
|
925
|
+
};
|
926
|
+
}
|
927
|
+
|
741
928
|
function isEqualModel<T extends CustomType | SharedSlice>(
|
742
929
|
modelA: T,
|
743
930
|
modelB: T,
|
@@ -35,8 +35,6 @@ export const SegmentEventType = {
|
|
35
35
|
devCollab_setUpWorkflowOpened: "dev-collab:set-up-workflow-opened",
|
36
36
|
devCollab_workflowStubDisplayed: "dev-collab:workflow-stub-displayed",
|
37
37
|
sliceMachine_start: "slice-machine:start",
|
38
|
-
sliceLibrary_beta_modalOpened: "slice-library:beta:modal-opened",
|
39
|
-
sliceLibrary_beta_codeOpened: "slice-library:beta:code-opened",
|
40
38
|
postPush_emptyStateCtaClicked: "post-push:empty-state-cta-clicked",
|
41
39
|
postPush_toastCtaClicked: "post-push:toast-cta-clicked",
|
42
40
|
experiment_exposure: "experiment:exposure",
|
@@ -45,6 +43,7 @@ export const SegmentEventType = {
|
|
45
43
|
sharedOnboarding_completed: "shared-onboarding:completed",
|
46
44
|
sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial",
|
47
45
|
sliceGenerationFeedback: "slice-generation-feedback",
|
46
|
+
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
|
48
47
|
} as const;
|
49
48
|
type SegmentEventTypes =
|
50
49
|
(typeof SegmentEventType)[keyof typeof SegmentEventType];
|
@@ -88,10 +87,6 @@ export const HumanSegmentEventType = {
|
|
88
87
|
[SegmentEventType.devCollab_workflowStubDisplayed]:
|
89
88
|
"SliceMachine Dev Collab Workflow Stub Displayed",
|
90
89
|
[SegmentEventType.sliceMachine_start]: "SliceMachine Start",
|
91
|
-
[SegmentEventType.sliceLibrary_beta_modalOpened]:
|
92
|
-
"SliceMachine Slice Library [BETA] CTA modal displayed",
|
93
|
-
[SegmentEventType.sliceLibrary_beta_codeOpened]:
|
94
|
-
"SliceMachine Slice Library [BETA] CTA example code opened",
|
95
90
|
[SegmentEventType.postPush_emptyStateCtaClicked]:
|
96
91
|
"SliceMachine Post Push Empty State CTA Clicked",
|
97
92
|
[SegmentEventType.postPush_toastCtaClicked]:
|
@@ -106,6 +101,8 @@ export const HumanSegmentEventType = {
|
|
106
101
|
[SegmentEventType.sharedOnboarding_tutorial]:
|
107
102
|
"Prismic Onboarding Guide Follow Tutorial",
|
108
103
|
[SegmentEventType.sliceGenerationFeedback]: "Slice Generation Feedback",
|
104
|
+
[SegmentEventType.navigation_documentationLinkClicked]:
|
105
|
+
"SliceMachine Documentation Link Clicked",
|
109
106
|
} as const;
|
110
107
|
|
111
108
|
export type HumanSegmentEventTypes =
|
@@ -375,14 +372,6 @@ type SliceMachineStart = SegmentEvent<
|
|
375
372
|
}
|
376
373
|
>;
|
377
374
|
|
378
|
-
type SliceLibraryBetaModalOpened = SegmentEvent<
|
379
|
-
typeof SegmentEventType.sliceLibrary_beta_modalOpened
|
380
|
-
>;
|
381
|
-
|
382
|
-
type SliceLibraryBetaCodeOpened = SegmentEvent<
|
383
|
-
typeof SegmentEventType.sliceLibrary_beta_codeOpened
|
384
|
-
>;
|
385
|
-
|
386
375
|
type OnboardingCommonPayload = { stepId: string; stepTitle: string };
|
387
376
|
type SharedOnboardingProperties<T = Record<string, string>> = T & {
|
388
377
|
source: "SliceMachine";
|
@@ -431,6 +420,13 @@ type SliceGenerationFeedback = SegmentEvent<
|
|
431
420
|
}
|
432
421
|
>;
|
433
422
|
|
423
|
+
type NavigationDocumentationLinkClicked = SegmentEvent<
|
424
|
+
typeof SegmentEventType.navigation_documentationLinkClicked,
|
425
|
+
{
|
426
|
+
framework: string;
|
427
|
+
}
|
428
|
+
>;
|
429
|
+
|
434
430
|
export type SegmentEvents =
|
435
431
|
| CommandInitStartSegmentEvent
|
436
432
|
| CommandInitIdentifySegmentEvent
|
@@ -461,8 +457,6 @@ export type SegmentEvents =
|
|
461
457
|
| DevCollabSetUpWorkflowOpened
|
462
458
|
| DevCollabWorkflowStubDisplayed
|
463
459
|
| SliceMachineStart
|
464
|
-
| SliceLibraryBetaModalOpened
|
465
|
-
| SliceLibraryBetaCodeOpened
|
466
460
|
| SliceMachineSharedOnboardingStepOpened
|
467
461
|
| SliceMachineSharedOnboardingStepCompleted
|
468
462
|
| SliceMachineSharedOnboardingCompleted
|
@@ -470,4 +464,5 @@ export type SegmentEvents =
|
|
470
464
|
| SliceMachinePostPushEmptyStateCtaClicked
|
471
465
|
| SliceMachinePostPushToastCtaClicked
|
472
466
|
| SliceMachineExperimentExposure
|
473
|
-
| SliceGenerationFeedback
|
467
|
+
| SliceGenerationFeedback
|
468
|
+
| NavigationDocumentationLinkClicked;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/npm-run-path/index.js"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport url from 'node:url';\nimport pathKey from 'path-key';\n\nexport function npmRunPath(options = {}) {\n\tconst {\n\t\tcwd = process.cwd(),\n\t\tpath: path_ = process.env[pathKey()],\n\t\texecPath = process.execPath,\n\t} = options;\n\n\tlet previous;\n\tconst cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;\n\tlet cwdPath = path.resolve(cwdString);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used.\n\tresult.push(path.resolve(cwdString, execPath, '..'));\n\n\treturn [...result, path_].join(path.delimiter);\n}\n\nexport function npmRunPathEnv({env = process.env, ...options} = {}) {\n\tenv = {...env};\n\n\tconst path = pathKey({env});\n\toptions.path = env[path];\n\tenv[path] = npmRunPath(options);\n\n\treturn env;\n}\n"],"names":["pathKey","path"],"mappings":";;;;;;AAKO,SAAS,WAAW,UAAU,IAAI;AACxC,QAAM;AAAA,IACL,MAAM,QAAQ,IAAK;AAAA,IACnB,MAAM,QAAQ,QAAQ,IAAIA,MAAO,CAAE;AAAA,IACnC,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI;AACJ,QAAM,YAAY,eAAe,MAAM,IAAI,cAAc,GAAG,IAAI;AAChE,MAAI,UAAU,KAAK,QAAQ,SAAS;AACpC,QAAM,SAAS,CAAA;AAEf,SAAO,aAAa,SAAS;AAC5B,WAAO,KAAK,KAAK,KAAK,SAAS,mBAAmB,CAAC;AACnD,eAAW;AACX,cAAU,KAAK,QAAQ,SAAS,IAAI;AAAA,EACpC;AAGD,SAAO,KAAK,KAAK,QAAQ,WAAW,UAAU,IAAI,CAAC;AAEnD,SAAO,CAAC,GAAG,QAAQ,KAAK,EAAE,KAAK,KAAK,SAAS;AAC9C;AAEO,SAAS,cAAc,EAAC,MAAM,QAAQ,KAAK,GAAG,QAAO,IAAI,IAAI;AACnE,QAAM,EAAC,GAAG,IAAG;AAEb,QAAMC,QAAOD,MAAQ,EAAC,IAAG,CAAC;AAC1B,UAAQ,OAAO,IAAIC,KAAI;AACvB,MAAIA,KAAI,IAAI,WAAW,OAAO;AAE9B,SAAO;AACR;;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/npm-run-path/index.js"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport url from 'node:url';\nimport pathKey from 'path-key';\n\nexport function npmRunPath(options = {}) {\n\tconst {\n\t\tcwd = process.cwd(),\n\t\tpath: path_ = process.env[pathKey()],\n\t\texecPath = process.execPath,\n\t} = options;\n\n\tlet previous;\n\tconst cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;\n\tlet cwdPath = path.resolve(cwdString);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used.\n\tresult.push(path.resolve(cwdString, execPath, '..'));\n\n\treturn [...result, path_].join(path.delimiter);\n}\n\nexport function npmRunPathEnv({env = process.env, ...options} = {}) {\n\tenv = {...env};\n\n\tconst path = pathKey({env});\n\toptions.path = env[path];\n\tenv[path] = npmRunPath(options);\n\n\treturn env;\n}\n"],"names":["path"],"mappings":";;;;AAKO,SAAS,WAAW,UAAU,IAAI;AACxC,QAAM;AAAA,IACL,MAAM,QAAQ,IAAK;AAAA,IACnB,MAAM,QAAQ,QAAQ,IAAI,QAAO,CAAE;AAAA,IACnC,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI;AACJ,QAAM,YAAY,eAAe,MAAM,IAAI,cAAc,GAAG,IAAI;AAChE,MAAI,UAAUA,cAAK,QAAQ,SAAS;AACpC,QAAM,SAAS,CAAA;AAEf,SAAO,aAAa,SAAS;AAC5B,WAAO,KAAKA,cAAK,KAAK,SAAS,mBAAmB,CAAC;AACnD,eAAW;AACX,cAAUA,cAAK,QAAQ,SAAS,IAAI;AAAA,EACpC;AAGD,SAAO,KAAKA,cAAK,QAAQ,WAAW,UAAU,IAAI,CAAC;AAEnD,SAAO,CAAC,GAAG,QAAQ,KAAK,EAAE,KAAKA,cAAK,SAAS;AAC9C;AAEO,SAAS,cAAc,EAAC,MAAM,QAAQ,KAAK,GAAG,QAAO,IAAI,IAAI;AACnE,QAAM,EAAC,GAAG,IAAG;AAEb,QAAM,OAAO,QAAQ,EAAC,IAAG,CAAC;AAC1B,UAAQ,OAAO,IAAI,IAAI;AACvB,MAAI,IAAI,IAAI,WAAW,OAAO;AAE9B,SAAO;AACR;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/onetime/index.js"],"sourcesContent":["import mimicFunction from 'mimic-fn';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n"],"names":["onetime","mimicFunction"],"mappings":";;AAEA,MAAM,kBAAkB,oBAAI;AAEvB,MAAC,UAAU,CAAC,WAAW,UAAU,OAAO;AAC5C,MAAI,OAAO,cAAc,YAAY;AACpC,UAAM,IAAI,UAAU,qBAAqB;AAAA,EACzC;AAED,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,eAAe,UAAU,eAAe,UAAU,QAAQ;AAEhE,QAAMA,WAAU,YAAa,YAAY;AACxC,oBAAgB,IAAIA,UAAS,EAAE,SAAS;AAExC,QAAI,cAAc,GAAG;AACpB,oBAAc,UAAU,MAAM,MAAM,UAAU;AAC9C,kBAAY;AAAA,IACf,WAAa,QAAQ,UAAU,MAAM;AAClC,YAAM,IAAI,MAAM,cAAc,YAAY,4BAA4B;AAAA,IACtE;AAED,WAAO;AAAA,EACT;AAECC,QAAcD,UAAS,SAAS;AAChC,kBAAgB,IAAIA,UAAS,SAAS;AAEtC,SAAOA;AACR;AAEA,QAAQ,YAAY,eAAa;AAChC,MAAI,CAAC,gBAAgB,IAAI,SAAS,GAAG;AACpC,UAAM,IAAI,MAAM,wBAAwB,UAAU,IAAI,8CAA8C;AAAA,EACpG;AAED,SAAO,gBAAgB,IAAI,SAAS;AACrC;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/onetime/index.js"],"sourcesContent":["import mimicFunction from 'mimic-fn';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n"],"names":["onetime"],"mappings":";AAEA,MAAM,kBAAkB,oBAAI;AAEvB,MAAC,UAAU,CAAC,WAAW,UAAU,OAAO;AAC5C,MAAI,OAAO,cAAc,YAAY;AACpC,UAAM,IAAI,UAAU,qBAAqB;AAAA,EACzC;AAED,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,eAAe,UAAU,eAAe,UAAU,QAAQ;AAEhE,QAAMA,WAAU,YAAa,YAAY;AACxC,oBAAgB,IAAIA,UAAS,EAAE,SAAS;AAExC,QAAI,cAAc,GAAG;AACpB,oBAAc,UAAU,MAAM,MAAM,UAAU;AAC9C,kBAAY;AAAA,IACf,WAAa,QAAQ,UAAU,MAAM;AAClC,YAAM,IAAI,MAAM,cAAc,YAAY,4BAA4B;AAAA,IACtE;AAED,WAAO;AAAA,EACT;AAEC,gBAAcA,UAAS,SAAS;AAChC,kBAAgB,IAAIA,UAAS,SAAS;AAEtC,SAAOA;AACR;AAEA,QAAQ,YAAY,eAAa;AAChC,MAAI,CAAC,gBAAgB,IAAI,SAAS,GAAG;AACpC,UAAM,IAAI,MAAM,wBAAwB,UAAU,IAAI,8CAA8C;AAAA,EACpG;AAED,SAAO,gBAAgB,IAAI,SAAS;AACrC;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/path-key/index.js"],"sourcesContent":["export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n"],"names":[],"mappings":";AAAe,SAAS,QAAQ,UAAU,IAAI;AAC7C,QAAM;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI,aAAa,SAAS;AACzB,WAAO;AAAA,EACP;AAED,SAAO,OAAO,KAAK,GAAG,EAAE,QAAO,EAAG,KAAK,SAAO,IAAI,YAAW,MAAO,MAAM,KAAK;AAChF;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/path-key/index.js"],"sourcesContent":["export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n"],"names":[],"mappings":"AAAe,SAAS,QAAQ,UAAU,IAAI;AAC7C,QAAM;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI,aAAa,SAAS;AACzB,WAAO;AAAA,EACP;AAED,SAAO,OAAO,KAAK,GAAG,EAAE,QAAO,EAAG,KAAK,SAAO,IAAI,YAAW,MAAO,MAAM,KAAK;AAChF;","x_google_ignoreList":[0]}
|
File without changes
|
File without changes
|