@wordpress/patterns 2.43.0 → 2.43.1-next.v.202604091042.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.
package/build/store/actions.cjs
CHANGED
|
@@ -48,7 +48,7 @@ var createPatternFromFile = (file, categories) => async ({ dispatch }) => {
|
|
|
48
48
|
let parsedContent;
|
|
49
49
|
try {
|
|
50
50
|
parsedContent = JSON.parse(fileContent);
|
|
51
|
-
} catch
|
|
51
|
+
} catch {
|
|
52
52
|
throw new Error("Invalid JSON file");
|
|
53
53
|
}
|
|
54
54
|
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/actions.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { getBlockType, cloneBlock } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.\n *\n * @param {string} title Pattern title.\n * @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.\n * @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPattern =\n\t( title, syncType, content, categories ) =>\n\tasync ( { registry } ) => {\n\t\tconst meta =\n\t\t\tsyncType === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? {\n\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst reusableBlock = {\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tstatus: 'publish',\n\t\t\tmeta,\n\t\t\twp_pattern_category: categories,\n\t\t};\n\n\t\tconst updatedRecord = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_block', reusableBlock );\n\n\t\treturn updatedRecord;\n\t};\n\n/**\n * Create a pattern from a JSON file.\n * @param {File} file The JSON file instance of the pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPatternFromFile =\n\t( file, categories ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst fileContent = await file.text();\n\t\t/** @type {import('./types').PatternJSON} */\n\t\tlet parsedContent;\n\t\ttry {\n\t\t\tparsedContent = JSON.parse( fileContent );\n\t\t} catch
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAyC;AACzC,uBAAmC;AACnC,0BAA0C;AAK1C,uBAAmC;AAU5B,IAAM,gBACZ,CAAE,OAAO,UAAU,SAAS,eAC5B,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,OACL,aAAa,oCAAmB,WAC7B;AAAA,IACA,wBAAwB;AAAA,EACxB,IACA;AAEJ,QAAM,gBAAgB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,qBAAqB;AAAA,EACtB;AAEA,QAAM,gBAAgB,MAAM,SAC1B,SAAU,iBAAAA,KAAU,EACpB,iBAAkB,YAAY,YAAY,aAAc;AAE1D,SAAO;AACR;AAOM,IAAM,wBACZ,CAAE,MAAM,eACR,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,cAAc,MAAM,KAAK,KAAK;AAEpC,MAAI;AACJ,MAAI;AACH,oBAAgB,KAAK,MAAO,WAAY;AAAA,EACzC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { getBlockType, cloneBlock } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.\n *\n * @param {string} title Pattern title.\n * @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.\n * @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPattern =\n\t( title, syncType, content, categories ) =>\n\tasync ( { registry } ) => {\n\t\tconst meta =\n\t\t\tsyncType === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? {\n\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst reusableBlock = {\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tstatus: 'publish',\n\t\t\tmeta,\n\t\t\twp_pattern_category: categories,\n\t\t};\n\n\t\tconst updatedRecord = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_block', reusableBlock );\n\n\t\treturn updatedRecord;\n\t};\n\n/**\n * Create a pattern from a JSON file.\n * @param {File} file The JSON file instance of the pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPatternFromFile =\n\t( file, categories ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst fileContent = await file.text();\n\t\t/** @type {import('./types').PatternJSON} */\n\t\tlet parsedContent;\n\t\ttry {\n\t\t\tparsedContent = JSON.parse( fileContent );\n\t\t} catch {\n\t\t\tthrow new Error( 'Invalid JSON file' );\n\t\t}\n\t\tif (\n\t\t\tparsedContent.__file !== 'wp_block' ||\n\t\t\t! parsedContent.title ||\n\t\t\t! parsedContent.content ||\n\t\t\ttypeof parsedContent.title !== 'string' ||\n\t\t\ttypeof parsedContent.content !== 'string' ||\n\t\t\t( parsedContent.syncStatus &&\n\t\t\t\ttypeof parsedContent.syncStatus !== 'string' )\n\t\t) {\n\t\t\tthrow new Error( 'Invalid pattern JSON file' );\n\t\t}\n\n\t\tconst pattern = await dispatch.createPattern(\n\t\t\tparsedContent.title,\n\t\t\tparsedContent.syncStatus,\n\t\t\tparsedContent.content,\n\t\t\tcategories\n\t\t);\n\n\t\treturn pattern;\n\t};\n\n/**\n * Returns a generator converting a synced pattern block into a static block.\n *\n * @param {string} clientId The client ID of the block to attach.\n */\nexport const convertSyncedPatternToStatic =\n\t( clientId ) =>\n\t( { registry } ) => {\n\t\tconst patternBlock = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlock( clientId );\n\t\tconst existingOverrides = patternBlock.attributes?.content;\n\n\t\tfunction cloneBlocksAndRemoveBindings( blocks ) {\n\t\t\treturn blocks.map( ( block ) => {\n\t\t\t\tlet metadata = block.attributes.metadata;\n\t\t\t\tif ( metadata ) {\n\t\t\t\t\tmetadata = { ...metadata };\n\t\t\t\t\tdelete metadata.id;\n\t\t\t\t\tdelete metadata.bindings;\n\t\t\t\t\t// Use overridden values of the pattern block if they exist.\n\t\t\t\t\tif ( existingOverrides?.[ metadata.name ] ) {\n\t\t\t\t\t\t// Iterate over each overridden attribute.\n\t\t\t\t\t\tfor ( const [ attributeName, value ] of Object.entries(\n\t\t\t\t\t\t\texistingOverrides[ metadata.name ]\n\t\t\t\t\t\t) ) {\n\t\t\t\t\t\t\t// Skip if the attribute does not exist in the block type.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t! getBlockType( block.name )?.attributes[\n\t\t\t\t\t\t\t\t\tattributeName\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Update the block attribute with the override value.\n\t\t\t\t\t\t\tblock.attributes[ attributeName ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn cloneBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata:\n\t\t\t\t\t\t\tmetadata && Object.keys( metadata ).length > 0\n\t\t\t\t\t\t\t\t? metadata\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tcloneBlocksAndRemoveBindings( block.innerBlocks )\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tconst patternInnerBlocks = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlocks( patternBlock.clientId );\n\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.replaceBlocks(\n\t\t\t\tpatternBlock.clientId,\n\t\t\t\tcloneBlocksAndRemoveBindings( patternInnerBlocks )\n\t\t\t);\n\t};\n\n/**\n * Returns an action descriptor for SET_EDITING_PATTERN action.\n *\n * @param {string} clientId The clientID of the pattern to target.\n * @param {boolean} isEditing Whether the block should be in editing state.\n * @return {Object} Action descriptor.\n */\nexport function setEditingPattern( clientId, isEditing ) {\n\treturn {\n\t\ttype: 'SET_EDITING_PATTERN',\n\t\tclientId,\n\t\tisEditing,\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAyC;AACzC,uBAAmC;AACnC,0BAA0C;AAK1C,uBAAmC;AAU5B,IAAM,gBACZ,CAAE,OAAO,UAAU,SAAS,eAC5B,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,OACL,aAAa,oCAAmB,WAC7B;AAAA,IACA,wBAAwB;AAAA,EACxB,IACA;AAEJ,QAAM,gBAAgB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,qBAAqB;AAAA,EACtB;AAEA,QAAM,gBAAgB,MAAM,SAC1B,SAAU,iBAAAA,KAAU,EACpB,iBAAkB,YAAY,YAAY,aAAc;AAE1D,SAAO;AACR;AAOM,IAAM,wBACZ,CAAE,MAAM,eACR,OAAQ,E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AY;AAAA,MACjD;AAAA,IACD,CAAE;AAAA,EACH;AAEA,QAAM,qBAAqB,SACzB,OAAQ,oBAAAA,KAAiB,EACzB,UAAW,aAAa,QAAS;AAEnC,WACE,SAAU,oBAAAA,KAAiB,EAC3B;AAAA,IACA,aAAa;AAAA,IACb,6BAA8B,kBAAmB;AAAA,EAClD;AACF;AASM,SAAS,kBAAmB,UAAU,WAAY;AACxD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
|
|
6
6
|
"names": ["coreStore", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ var createPatternFromFile = (file, categories) => async ({ dispatch }) => {
|
|
|
22
22
|
let parsedContent;
|
|
23
23
|
try {
|
|
24
24
|
parsedContent = JSON.parse(fileContent);
|
|
25
|
-
} catch
|
|
25
|
+
} catch {
|
|
26
26
|
throw new Error("Invalid JSON file");
|
|
27
27
|
}
|
|
28
28
|
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/actions.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { getBlockType, cloneBlock } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.\n *\n * @param {string} title Pattern title.\n * @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.\n * @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPattern =\n\t( title, syncType, content, categories ) =>\n\tasync ( { registry } ) => {\n\t\tconst meta =\n\t\t\tsyncType === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? {\n\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst reusableBlock = {\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tstatus: 'publish',\n\t\t\tmeta,\n\t\t\twp_pattern_category: categories,\n\t\t};\n\n\t\tconst updatedRecord = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_block', reusableBlock );\n\n\t\treturn updatedRecord;\n\t};\n\n/**\n * Create a pattern from a JSON file.\n * @param {File} file The JSON file instance of the pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPatternFromFile =\n\t( file, categories ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst fileContent = await file.text();\n\t\t/** @type {import('./types').PatternJSON} */\n\t\tlet parsedContent;\n\t\ttry {\n\t\t\tparsedContent = JSON.parse( fileContent );\n\t\t} catch
|
|
5
|
-
"mappings": ";AAIA,SAAS,cAAc,kBAAkB;AACzC,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,0BAA0B;AAU5B,IAAM,gBACZ,CAAE,OAAO,UAAU,SAAS,eAC5B,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,OACL,aAAa,mBAAmB,WAC7B;AAAA,IACA,wBAAwB;AAAA,EACxB,IACA;AAEJ,QAAM,gBAAgB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,qBAAqB;AAAA,EACtB;AAEA,QAAM,gBAAgB,MAAM,SAC1B,SAAU,SAAU,EACpB,iBAAkB,YAAY,YAAY,aAAc;AAE1D,SAAO;AACR;AAOM,IAAM,wBACZ,CAAE,MAAM,eACR,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,cAAc,MAAM,KAAK,KAAK;AAEpC,MAAI;AACJ,MAAI;AACH,oBAAgB,KAAK,MAAO,WAAY;AAAA,EACzC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\n\nimport { getBlockType, cloneBlock } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_SYNC_TYPES } from '../constants';\n\n/**\n * Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.\n *\n * @param {string} title Pattern title.\n * @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.\n * @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPattern =\n\t( title, syncType, content, categories ) =>\n\tasync ( { registry } ) => {\n\t\tconst meta =\n\t\t\tsyncType === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t? {\n\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst reusableBlock = {\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tstatus: 'publish',\n\t\t\tmeta,\n\t\t\twp_pattern_category: categories,\n\t\t};\n\n\t\tconst updatedRecord = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_block', reusableBlock );\n\n\t\treturn updatedRecord;\n\t};\n\n/**\n * Create a pattern from a JSON file.\n * @param {File} file The JSON file instance of the pattern.\n * @param {number[]|undefined} [categories] Ids of any selected categories.\n */\nexport const createPatternFromFile =\n\t( file, categories ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst fileContent = await file.text();\n\t\t/** @type {import('./types').PatternJSON} */\n\t\tlet parsedContent;\n\t\ttry {\n\t\t\tparsedContent = JSON.parse( fileContent );\n\t\t} catch {\n\t\t\tthrow new Error( 'Invalid JSON file' );\n\t\t}\n\t\tif (\n\t\t\tparsedContent.__file !== 'wp_block' ||\n\t\t\t! parsedContent.title ||\n\t\t\t! parsedContent.content ||\n\t\t\ttypeof parsedContent.title !== 'string' ||\n\t\t\ttypeof parsedContent.content !== 'string' ||\n\t\t\t( parsedContent.syncStatus &&\n\t\t\t\ttypeof parsedContent.syncStatus !== 'string' )\n\t\t) {\n\t\t\tthrow new Error( 'Invalid pattern JSON file' );\n\t\t}\n\n\t\tconst pattern = await dispatch.createPattern(\n\t\t\tparsedContent.title,\n\t\t\tparsedContent.syncStatus,\n\t\t\tparsedContent.content,\n\t\t\tcategories\n\t\t);\n\n\t\treturn pattern;\n\t};\n\n/**\n * Returns a generator converting a synced pattern block into a static block.\n *\n * @param {string} clientId The client ID of the block to attach.\n */\nexport const convertSyncedPatternToStatic =\n\t( clientId ) =>\n\t( { registry } ) => {\n\t\tconst patternBlock = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlock( clientId );\n\t\tconst existingOverrides = patternBlock.attributes?.content;\n\n\t\tfunction cloneBlocksAndRemoveBindings( blocks ) {\n\t\t\treturn blocks.map( ( block ) => {\n\t\t\t\tlet metadata = block.attributes.metadata;\n\t\t\t\tif ( metadata ) {\n\t\t\t\t\tmetadata = { ...metadata };\n\t\t\t\t\tdelete metadata.id;\n\t\t\t\t\tdelete metadata.bindings;\n\t\t\t\t\t// Use overridden values of the pattern block if they exist.\n\t\t\t\t\tif ( existingOverrides?.[ metadata.name ] ) {\n\t\t\t\t\t\t// Iterate over each overridden attribute.\n\t\t\t\t\t\tfor ( const [ attributeName, value ] of Object.entries(\n\t\t\t\t\t\t\texistingOverrides[ metadata.name ]\n\t\t\t\t\t\t) ) {\n\t\t\t\t\t\t\t// Skip if the attribute does not exist in the block type.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t! getBlockType( block.name )?.attributes[\n\t\t\t\t\t\t\t\t\tattributeName\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Update the block attribute with the override value.\n\t\t\t\t\t\t\tblock.attributes[ attributeName ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn cloneBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata:\n\t\t\t\t\t\t\tmetadata && Object.keys( metadata ).length > 0\n\t\t\t\t\t\t\t\t? metadata\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tcloneBlocksAndRemoveBindings( block.innerBlocks )\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tconst patternInnerBlocks = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlocks( patternBlock.clientId );\n\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.replaceBlocks(\n\t\t\t\tpatternBlock.clientId,\n\t\t\t\tcloneBlocksAndRemoveBindings( patternInnerBlocks )\n\t\t\t);\n\t};\n\n/**\n * Returns an action descriptor for SET_EDITING_PATTERN action.\n *\n * @param {string} clientId The clientID of the pattern to target.\n * @param {boolean} isEditing Whether the block should be in editing state.\n * @return {Object} Action descriptor.\n */\nexport function setEditingPattern( clientId, isEditing ) {\n\treturn {\n\t\ttype: 'SET_EDITING_PATTERN',\n\t\tclientId,\n\t\tisEditing,\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";AAIA,SAAS,cAAc,kBAAkB;AACzC,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,0BAA0B;AAU5B,IAAM,gBACZ,CAAE,OAAO,UAAU,SAAS,eAC5B,OAAQ,EAAE,SAAS,MAAO;AACzB,QAAM,OACL,aAAa,mBAAmB,WAC7B;AAAA,IACA,wBAAwB;AAAA,EACxB,IACA;AAEJ,QAAM,gBAAgB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,qBAAqB;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AA,MACD;AACA,aAAO;AAAA,QACN;AAAA,QACA;AAAA,UACC,UACC,YAAY,OAAO,KAAM,QAAS,EAAE,SAAS,IAC1C,WACA;AAAA,QACL;AAAA,QACA,6BAA8B,MAAM,WAAY;AAAA,MACjD;AAAA,IACD,CAAE;AAAA,EACH;AAEA,QAAM,qBAAqB,SACzB,OAAQ,gBAAiB,EACzB,UAAW,aAAa,QAAS;AAEnC,WACE,SAAU,gBAAiB,EAC3B;AAAA,IACA,aAAa;AAAA,IACb,6BAA8B,kBAAmB;AAAA,EAClD;AACF;AASM,SAAS,kBAAmB,UAAU,WAAY;AACxD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/patterns",
|
|
3
|
-
"version": "2.43.0",
|
|
3
|
+
"version": "2.43.1-next.v.202604091042.0+668146787",
|
|
4
4
|
"description": "Management of user pattern editing.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -52,21 +52,21 @@
|
|
|
52
52
|
"build-module/store/index.mjs"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@wordpress/a11y": "^4.43.0",
|
|
56
|
-
"@wordpress/base-styles": "^6.19.0",
|
|
57
|
-
"@wordpress/block-editor": "^15.16.0",
|
|
58
|
-
"@wordpress/blocks": "^15.16.0",
|
|
59
|
-
"@wordpress/components": "^32.5.0",
|
|
60
|
-
"@wordpress/compose": "^7.43.0",
|
|
61
|
-
"@wordpress/core-data": "^7.43.0",
|
|
62
|
-
"@wordpress/data": "^10.43.0",
|
|
63
|
-
"@wordpress/element": "^6.
|
|
64
|
-
"@wordpress/html-entities": "^4.43.0",
|
|
65
|
-
"@wordpress/i18n": "^6.
|
|
66
|
-
"@wordpress/icons": "^12.1.0",
|
|
67
|
-
"@wordpress/notices": "^5.43.0",
|
|
68
|
-
"@wordpress/private-apis": "^1.43.0",
|
|
69
|
-
"@wordpress/url": "^4.43.0"
|
|
55
|
+
"@wordpress/a11y": "^4.43.1-next.v.202604091042.0+668146787",
|
|
56
|
+
"@wordpress/base-styles": "^6.19.1-next.v.202604091042.0+668146787",
|
|
57
|
+
"@wordpress/block-editor": "^15.16.1-next.v.202604091042.0+668146787",
|
|
58
|
+
"@wordpress/blocks": "^15.16.1-next.v.202604091042.0+668146787",
|
|
59
|
+
"@wordpress/components": "^32.5.2-next.v.202604091042.0+668146787",
|
|
60
|
+
"@wordpress/compose": "^7.43.1-next.v.202604091042.0+668146787",
|
|
61
|
+
"@wordpress/core-data": "^7.43.2-next.v.202604091042.0+668146787",
|
|
62
|
+
"@wordpress/data": "^10.43.1-next.v.202604091042.0+668146787",
|
|
63
|
+
"@wordpress/element": "^6.44.1-next.v.202604091042.0+668146787",
|
|
64
|
+
"@wordpress/html-entities": "^4.43.1-next.v.202604091042.0+668146787",
|
|
65
|
+
"@wordpress/i18n": "^6.17.1-next.v.202604091042.0+668146787",
|
|
66
|
+
"@wordpress/icons": "^12.1.1-next.v.202604091042.0+668146787",
|
|
67
|
+
"@wordpress/notices": "^5.43.1-next.v.202604091042.0+668146787",
|
|
68
|
+
"@wordpress/private-apis": "^1.43.1-next.v.202604091042.0+668146787",
|
|
69
|
+
"@wordpress/url": "^4.43.1-next.v.202604091042.0+668146787"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"react": "^18.0.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "73606df74f1c38a084bfa5db97205259ef817593"
|
|
79
79
|
}
|