@liiift-studio/sanity-font-manager 2.6.0 → 2.7.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/LICENSE +21 -0
- package/README.md +695 -437
- package/dist/index.js +1628 -17701
- package/dist/index.mjs +1537 -17599
- package/package.json +83 -83
- package/src/components/BatchUploadFonts.jsx +655 -653
- package/src/components/BulkActions.jsx +99 -99
- package/src/components/ExistingDocumentResolver.jsx +152 -152
- package/src/components/FontReviewCard.jsx +455 -455
- package/src/components/FontScriptUploaderComponent.jsx +463 -463
- package/src/components/GenerateCollectionsPairsComponent.jsx +259 -259
- package/src/components/KeyValueInput.jsx +95 -95
- package/src/components/KeyValueReferenceInput.jsx +267 -267
- package/src/components/NestedObjectArraySelector.jsx +146 -146
- package/src/components/PriceInput.jsx +26 -26
- package/src/components/PrimaryCollectionGeneratorTypeface.jsx +116 -116
- package/src/components/RegenerateSubfamiliesComponent.jsx +185 -185
- package/src/components/SetOTF.jsx +87 -87
- package/src/components/SingleUploaderTool.jsx +674 -674
- package/src/components/StatusDisplay.jsx +26 -26
- package/src/components/StyleCountInput.jsx +16 -16
- package/src/components/UpdateScriptsComponent.jsx +76 -76
- package/src/components/UploadButton.jsx +43 -43
- package/src/components/UploadModal.jsx +309 -304
- package/src/components/UploadScriptsComponent.jsx +539 -539
- package/src/components/UploadStep1Settings.jsx +272 -272
- package/src/components/UploadStep2Review.jsx +478 -474
- package/src/components/UploadStep3Execute.jsx +234 -234
- package/src/components/UploadStep3bInstances.jsx +396 -396
- package/src/components/UploadSummary.jsx +196 -196
- package/src/components/VariableInstanceReferencesInput.jsx +190 -190
- package/src/hooks/useNestedObjects.js +92 -92
- package/src/hooks/useSanityClient.js +9 -9
- package/src/index.js +120 -120
- package/src/schema/openTypeField.js +1995 -1995
- package/src/schema/styleCountField.js +12 -12
- package/src/schema/stylesField.js +302 -302
- package/src/schema/stylisticSetField.js +301 -301
- package/src/utils/buildUploadPlan.js +326 -326
- package/src/utils/executeUploadPlan.js +430 -430
- package/src/utils/executionReducer.js +56 -56
- package/src/utils/fontHelpers.js +281 -267
- package/src/utils/generateCssFile.js +207 -207
- package/src/utils/generateFontData.js +98 -98
- package/src/utils/generateFontFile.js +38 -38
- package/src/utils/generateKeywords.js +185 -185
- package/src/utils/generateSubset.js +45 -45
- package/src/utils/getEmptyFontKit.js +101 -101
- package/src/utils/parseFont.js +56 -56
- package/src/utils/parseVariableFontInstances.js +301 -301
- package/src/utils/planReducer.js +531 -517
- package/src/utils/planTypes.js +183 -183
- package/src/utils/processFontFiles.js +530 -530
- package/src/utils/regenerateFontData.js +146 -146
- package/src/utils/resolveExistingFont.js +87 -87
- package/src/utils/retitleFontEntries.js +154 -0
- package/src/utils/sanitizeForSanityId.js +65 -65
- package/src/utils/setupDecompressors.js +27 -27
- package/src/utils/updateFontPrices.js +94 -94
- package/src/utils/updateTypefaceDocument.js +162 -162
- package/src/utils/uploadFontFiles.js +405 -405
- package/src/utils/utils.js +24 -24
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
// Execution reducer — manages ExecutionState separately from the plan to prevent progress ticks from re-rendering the review UI
|
|
2
|
-
|
|
3
|
-
import { EXECUTION_STATUS } from './planTypes';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates the initial execution state.
|
|
7
|
-
* @returns {object}
|
|
8
|
-
*/
|
|
9
|
-
export function createInitialExecutionState() {
|
|
10
|
-
return {
|
|
11
|
-
status: 'idle',
|
|
12
|
-
progress: {},
|
|
13
|
-
error: null,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Execution reducer for useReducer. Manages per-font upload progress.
|
|
19
|
-
* Mounted in UploadStep3Execute — isolated from the plan/review UI.
|
|
20
|
-
*
|
|
21
|
-
* @param {object} state - Current ExecutionState
|
|
22
|
-
* @param {object} action - Dispatched action
|
|
23
|
-
* @returns {object} New ExecutionState
|
|
24
|
-
*/
|
|
25
|
-
export function executionReducer(state, action) {
|
|
26
|
-
switch (action.type) {
|
|
27
|
-
case 'SET_EXECUTION_STATUS': {
|
|
28
|
-
return { ...state, status: action.status };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
case 'SET_FONT_EXECUTION_PROGRESS': {
|
|
32
|
-
const { tempId, progress } = action;
|
|
33
|
-
return {
|
|
34
|
-
...state,
|
|
35
|
-
progress: {
|
|
36
|
-
...state.progress,
|
|
37
|
-
[tempId]: {
|
|
38
|
-
...(state.progress[tempId] || {}),
|
|
39
|
-
...progress,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
case 'SET_EXECUTION_ERROR': {
|
|
46
|
-
return {
|
|
47
|
-
...state,
|
|
48
|
-
status: 'error',
|
|
49
|
-
error: action.error,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
default:
|
|
54
|
-
return state;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
// Execution reducer — manages ExecutionState separately from the plan to prevent progress ticks from re-rendering the review UI
|
|
2
|
+
|
|
3
|
+
import { EXECUTION_STATUS } from './planTypes';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates the initial execution state.
|
|
7
|
+
* @returns {object}
|
|
8
|
+
*/
|
|
9
|
+
export function createInitialExecutionState() {
|
|
10
|
+
return {
|
|
11
|
+
status: 'idle',
|
|
12
|
+
progress: {},
|
|
13
|
+
error: null,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Execution reducer for useReducer. Manages per-font upload progress.
|
|
19
|
+
* Mounted in UploadStep3Execute — isolated from the plan/review UI.
|
|
20
|
+
*
|
|
21
|
+
* @param {object} state - Current ExecutionState
|
|
22
|
+
* @param {object} action - Dispatched action
|
|
23
|
+
* @returns {object} New ExecutionState
|
|
24
|
+
*/
|
|
25
|
+
export function executionReducer(state, action) {
|
|
26
|
+
switch (action.type) {
|
|
27
|
+
case 'SET_EXECUTION_STATUS': {
|
|
28
|
+
return { ...state, status: action.status };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
case 'SET_FONT_EXECUTION_PROGRESS': {
|
|
32
|
+
const { tempId, progress } = action;
|
|
33
|
+
return {
|
|
34
|
+
...state,
|
|
35
|
+
progress: {
|
|
36
|
+
...state.progress,
|
|
37
|
+
[tempId]: {
|
|
38
|
+
...(state.progress[tempId] || {}),
|
|
39
|
+
...progress,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
case 'SET_EXECUTION_ERROR': {
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
status: 'error',
|
|
49
|
+
error: action.error,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
default:
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
}
|