@wordpress/block-editor 12.12.0 → 12.13.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/CHANGELOG.md +12 -10
- package/README.md +35 -3
- package/build/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-list/block.native.js +4 -4
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/layout.js +2 -3
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/border-radius-control/index.js +3 -2
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +6 -6
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/colors/with-colors.js +2 -8
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +6 -7
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -13
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/font-family/index.js +2 -3
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +3 -5
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +3 -4
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +7 -8
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -5
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/height-control/index.js +3 -3
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/index.js +9 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/link-control/search-item.js +11 -0
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -5
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +1 -1
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -3
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/unit-control/index.js +3 -3
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +6 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-settings/index.js +212 -0
- package/build/components/use-settings/index.js.map +1 -0
- package/build/hooks/align.js +51 -35
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +37 -32
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +4 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/color.js +2 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/duotone.js +10 -9
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-size.js +4 -4
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +10 -11
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +3 -3
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +2 -3
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-color-props.js +3 -11
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/utils.js +1 -42
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +3 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/utils/object.js +4 -1
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +19 -24
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-list/block.native.js +4 -4
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +2 -2
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +3 -2
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +6 -5
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/colors/with-colors.js +2 -7
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +6 -7
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -12
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/font-family/index.js +2 -2
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +3 -4
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +3 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +7 -8
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -4
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +3 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +3 -2
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/link-control/search-item.js +12 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +1 -1
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/unit-control/index.js +3 -2
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +5 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +203 -0
- package/build-module/components/use-settings/index.js.map +1 -0
- package/build-module/hooks/align.js +51 -35
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +37 -32
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +4 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/color.js +2 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/duotone.js +11 -10
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-size.js +4 -4
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +10 -11
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +3 -3
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/position.js +2 -3
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-color-props.js +3 -11
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -43
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +3 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/utils/object.js +3 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +20 -24
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/style-rtl.css +13 -6
- package/build-style/style.css +13 -6
- package/package.json +36 -34
- package/src/components/block-alignment-control/use-available-alignments.js +49 -34
- package/src/components/block-list/block.native.js +4 -4
- package/src/components/block-list/layout.js +2 -2
- package/src/components/block-styles/style.scss +1 -1
- package/src/components/border-radius-control/index.js +3 -2
- package/src/components/color-palette/with-color-context.js +9 -9
- package/src/components/colors/with-colors.js +6 -7
- package/src/components/colors-gradients/control.js +10 -7
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +29 -15
- package/src/components/font-family/index.js +2 -2
- package/src/components/font-sizes/font-size-picker.js +6 -4
- package/src/components/font-sizes/with-font-sizes.js +3 -5
- package/src/components/global-styles/filters-panel.js +9 -15
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/gradients/use-gradient.js +10 -4
- package/src/components/height-control/index.js +3 -2
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +1 -1
- package/src/components/inner-blocks/index.js +2 -2
- package/src/components/inserter/style.scss +9 -1
- package/src/components/letter-spacing-control/index.js +3 -2
- package/src/components/link-control/search-item.js +14 -0
- package/src/components/link-control/search-results.js +1 -0
- package/src/components/link-control/use-search-handler.js +22 -15
- package/src/components/resizable-box-popover/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +7 -5
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/src/components/unit-control/index.js +3 -8
- package/src/components/use-block-commands/index.js +2 -1
- package/src/components/{use-setting → use-settings}/README.md +9 -10
- package/src/components/use-settings/index.js +272 -0
- package/src/components/{use-setting → use-settings}/test/index.js +47 -5
- package/src/hooks/align.js +79 -54
- package/src/hooks/anchor.js +75 -65
- package/src/hooks/background.js +7 -9
- package/src/hooks/color.js +7 -4
- package/src/hooks/duotone.js +24 -19
- package/src/hooks/font-size.js +4 -4
- package/src/hooks/layout.js +11 -11
- package/src/hooks/line-height.js +3 -3
- package/src/hooks/position.js +5 -3
- package/src/hooks/use-color-props.js +21 -14
- package/src/hooks/utils.js +88 -43
- package/src/layouts/constrained.js +3 -8
- package/src/utils/object.js +4 -1
- package/src/utils/test/__snapshots__/transform-styles.js.snap +103 -0
- package/src/utils/test/transform-styles.js +217 -0
- package/src/utils/transform-styles/index.js +25 -25
- package/build/components/use-setting/index.js +0 -161
- package/build/components/use-setting/index.js.map +0 -1
- package/build/utils/transform-styles/ast/index.js +0 -21
- package/build/utils/transform-styles/ast/index.js.map +0 -1
- package/build/utils/transform-styles/ast/parse.js +0 -660
- package/build/utils/transform-styles/ast/parse.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compiler.js +0 -52
- package/build/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compress.js +0 -178
- package/build/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/identity.js +0 -207
- package/build/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/index.js +0 -36
- package/build/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +0 -130
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build/utils/transform-styles/transforms/wrap.js +0 -59
- package/build/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build/utils/transform-styles/traverse.js +0 -37
- package/build/utils/transform-styles/traverse.js.map +0 -1
- package/build-module/components/use-setting/index.js +0 -154
- package/build-module/components/use-setting/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/index.js +0 -6
- package/build-module/utils/transform-styles/ast/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/parse.js +0 -654
- package/build-module/utils/transform-styles/ast/parse.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compiler.js +0 -49
- package/build-module/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compress.js +0 -176
- package/build-module/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/identity.js +0 -206
- package/build-module/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/index.js +0 -29
- package/build-module/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +0 -123
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +0 -52
- package/build-module/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build-module/utils/transform-styles/traverse.js +0 -28
- package/build-module/utils/transform-styles/traverse.js.map +0 -1
- package/src/components/use-setting/index.js +0 -218
- package/src/utils/transform-styles/ast/index.js +0 -5
- package/src/utils/transform-styles/ast/parse.js +0 -732
- package/src/utils/transform-styles/ast/stringify/compiler.js +0 -50
- package/src/utils/transform-styles/ast/stringify/compress.js +0 -238
- package/src/utils/transform-styles/ast/stringify/identity.js +0 -286
- package/src/utils/transform-styles/ast/stringify/index.js +0 -32
- package/src/utils/transform-styles/test/__snapshots__/traverse.js.snap +0 -7
- package/src/utils/transform-styles/test/traverse.js +0 -24
- package/src/utils/transform-styles/transforms/test/__snapshots__/url-rewrite.js.snap +0 -25
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +0 -64
- package/src/utils/transform-styles/transforms/test/url-rewrite.js +0 -39
- package/src/utils/transform-styles/transforms/test/wrap.js +0 -95
- package/src/utils/transform-styles/transforms/url-rewrite.js +0 -139
- package/src/utils/transform-styles/transforms/wrap.js +0 -56
- package/src/utils/transform-styles/traverse.js +0 -32
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["commentre","css","options","lineno","column","updatePosition","str","lines","match","length","i","lastIndexOf","position","start","line","node","Position","whitespace","end","source","prototype","content","errorsList","error","msg","err","Error","reason","filename","silent","push","stylesheet","rulesList","rules","type","parsingErrors","open","close","accumulator","comments","charAt","atrule","rule","re","m","exec","slice","c","comment","pos","selector","trim","replace","matched","split","map","s","declaration","prop","val","ret","property","value","declarations","decls","decl","keyframe","vals","values","atkeyframes","vendor","name","frame","frames","concat","keyframes","atsupports","supports","style","athost","atmedia","media","atcontainer","container","atcustommedia","atpage","sel","selectors","atdocument","doc","document","atfontface","atimport","_compileAtrule","atcharset","atnamespace","RegExp","addParent","obj","parent","isNode","childParent","k","Array","isArray","forEach","v","Object","defineProperty","configurable","writable","enumerable"],"sources":["@wordpress/block-editor/src/utils/transform-styles/ast/parse.js"],"sourcesContent":["/* eslint-disable @wordpress/no-unused-vars-before-return */\n\n// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\n// http://www.w3.org/TR/CSS21/grammar.htm\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nexport default function ( css, options ) {\n\toptions = options || {};\n\n\t/**\n\t * Positional.\n\t */\n\n\tlet lineno = 1;\n\tlet column = 1;\n\n\t/**\n\t * Update lineno and column based on `str`.\n\t */\n\n\tfunction updatePosition( str ) {\n\t\tconst lines = str.match( /\\n/g );\n\t\tif ( lines ) {\n\t\t\tlineno += lines.length;\n\t\t}\n\t\tconst i = str.lastIndexOf( '\\n' );\n\t\t// eslint-disable-next-line no-bitwise\n\t\tcolumn = ~i ? str.length - i : column + str.length;\n\t}\n\n\t/**\n\t * Mark position and patch `node.position`.\n\t */\n\n\tfunction position() {\n\t\tconst start = { line: lineno, column };\n\t\treturn function ( node ) {\n\t\t\tnode.position = new Position( start );\n\t\t\twhitespace();\n\t\t\treturn node;\n\t\t};\n\t}\n\n\t/**\n\t * Store position information for a node\n\t */\n\n\tfunction Position( start ) {\n\t\tthis.start = start;\n\t\tthis.end = { line: lineno, column };\n\t\tthis.source = options.source;\n\t}\n\n\t/**\n\t * Non-enumerable source string\n\t */\n\n\tPosition.prototype.content = css;\n\n\t/**\n\t * Error `msg`.\n\t */\n\n\tconst errorsList = [];\n\n\tfunction error( msg ) {\n\t\tconst err = new Error(\n\t\t\toptions.source + ':' + lineno + ':' + column + ': ' + msg\n\t\t);\n\t\terr.reason = msg;\n\t\terr.filename = options.source;\n\t\terr.line = lineno;\n\t\terr.column = column;\n\t\terr.source = css;\n\n\t\tif ( options.silent ) {\n\t\t\terrorsList.push( err );\n\t\t} else {\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\t/**\n\t * Parse stylesheet.\n\t */\n\n\tfunction stylesheet() {\n\t\tconst rulesList = rules();\n\n\t\treturn {\n\t\t\ttype: 'stylesheet',\n\t\t\tstylesheet: {\n\t\t\t\tsource: options.source,\n\t\t\t\trules: rulesList,\n\t\t\t\tparsingErrors: errorsList,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Opening brace.\n\t */\n\n\tfunction open() {\n\t\treturn match( /^{\\s*/ );\n\t}\n\n\t/**\n\t * Closing brace.\n\t */\n\n\tfunction close() {\n\t\treturn match( /^}/ );\n\t}\n\n\t/**\n\t * Parse ruleset.\n\t */\n\n\tfunction rules() {\n\t\tlet node;\n\t\tconst accumulator = [];\n\t\twhitespace();\n\t\tcomments( accumulator );\n\t\twhile (\n\t\t\tcss.length &&\n\t\t\tcss.charAt( 0 ) !== '}' &&\n\t\t\t( node = atrule() || rule() )\n\t\t) {\n\t\t\tif ( node !== false ) {\n\t\t\t\taccumulator.push( node );\n\t\t\t\tcomments( accumulator );\n\t\t\t}\n\t\t}\n\t\treturn accumulator;\n\t}\n\n\t/**\n\t * Match `re` and return captures.\n\t */\n\n\tfunction match( re ) {\n\t\tconst m = re.exec( css );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\tconst str = m[ 0 ];\n\t\tupdatePosition( str );\n\t\tcss = css.slice( str.length );\n\t\treturn m;\n\t}\n\n\t/**\n\t * Parse whitespace.\n\t */\n\n\tfunction whitespace() {\n\t\tmatch( /^\\s*/ );\n\t}\n\n\t/**\n\t * Parse comments;\n\t */\n\n\tfunction comments( accumulator ) {\n\t\tlet c;\n\t\taccumulator = accumulator || [];\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( c = comment() ) ) {\n\t\t\tif ( c !== false ) {\n\t\t\t\taccumulator.push( c );\n\t\t\t}\n\t\t}\n\t\treturn accumulator;\n\t}\n\n\t/**\n\t * Parse comment.\n\t */\n\n\tfunction comment() {\n\t\tconst pos = position();\n\t\tif ( '/' !== css.charAt( 0 ) || '*' !== css.charAt( 1 ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = 2;\n\t\twhile (\n\t\t\t'' !== css.charAt( i ) &&\n\t\t\t( '*' !== css.charAt( i ) || '/' !== css.charAt( i + 1 ) )\n\t\t) {\n\t\t\t++i;\n\t\t}\n\t\ti += 2;\n\n\t\tif ( '' === css.charAt( i - 1 ) ) {\n\t\t\treturn error( 'End of comment missing' );\n\t\t}\n\n\t\tconst str = css.slice( 2, i - 2 );\n\t\tcolumn += 2;\n\t\tupdatePosition( str );\n\t\tcss = css.slice( i );\n\t\tcolumn += 2;\n\n\t\treturn pos( {\n\t\t\ttype: 'comment',\n\t\t\tcomment: str,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse selector.\n\t */\n\n\tfunction selector() {\n\t\tconst m = match( /^([^{]+)/ );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\t// FIXME: Remove all comments from selectors http://ostermiller.org/findcomment.html\n\t\treturn trim( m[ 0 ] )\n\t\t\t.replace( /\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '' )\n\t\t\t.replace( /\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, function ( matched ) {\n\t\t\t\treturn matched.replace( /,/g, '\\u200C' );\n\t\t\t} )\n\t\t\t.split( /\\s*(?![^(]*\\)),\\s*/ )\n\t\t\t.map( function ( s ) {\n\t\t\t\treturn s.replace( /\\u200C/g, ',' );\n\t\t\t} );\n\t}\n\n\t/**\n\t * Parse declaration.\n\t */\n\n\tfunction declaration() {\n\t\tconst pos = position();\n\n\t\t// prop.\n\t\tlet prop = match( /^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/ );\n\t\tif ( ! prop ) {\n\t\t\treturn;\n\t\t}\n\t\tprop = trim( prop[ 0 ] );\n\n\t\t// :\n\t\tif ( ! match( /^:\\s*/ ) ) {\n\t\t\treturn error( \"property missing ':'\" );\n\t\t}\n\n\t\t// val.\n\t\tconst val = match(\n\t\t\t/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/\n\t\t);\n\n\t\tconst ret = pos( {\n\t\t\ttype: 'declaration',\n\t\t\tproperty: prop.replace( commentre, '' ),\n\t\t\tvalue: val ? trim( val[ 0 ] ).replace( commentre, '' ) : '',\n\t\t} );\n\n\t\t// ;\n\t\tmatch( /^[;\\s]*/ );\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Parse declarations.\n\t */\n\n\tfunction declarations() {\n\t\tconst decls = [];\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"missing '{'\" );\n\t\t}\n\t\tcomments( decls );\n\n\t\t// declarations.\n\t\tlet decl;\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( decl = declaration() ) ) {\n\t\t\tif ( decl !== false ) {\n\t\t\t\tdecls.push( decl );\n\t\t\t\tcomments( decls );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"missing '}'\" );\n\t\t}\n\t\treturn decls;\n\t}\n\n\t/**\n\t * Parse keyframe.\n\t */\n\n\tfunction keyframe() {\n\t\tlet m;\n\t\tconst vals = [];\n\t\tconst pos = position();\n\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( m = match( /^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/ ) ) ) {\n\t\t\tvals.push( m[ 1 ] );\n\t\t\tmatch( /^,\\s*/ );\n\t\t}\n\n\t\tif ( ! vals.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'keyframe',\n\t\t\tvalues: vals,\n\t\t\tdeclarations: declarations(),\n\t\t} );\n\t}\n\n\t/**\n\t * Parse keyframes.\n\t */\n\n\tfunction atkeyframes() {\n\t\tconst pos = position();\n\t\tlet m = match( /^@([-\\w]+)?keyframes\\s*/ );\n\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\tconst vendor = m[ 1 ];\n\n\t\t// identifier\n\t\tm = match( /^([-\\w]+)\\s*/ );\n\t\tif ( ! m ) {\n\t\t\treturn error( '@keyframes missing name' );\n\t\t}\n\t\tconst name = m[ 1 ];\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@keyframes missing '{'\" );\n\t\t}\n\n\t\tlet frame;\n\t\tlet frames = comments();\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( frame = keyframe() ) ) {\n\t\t\tframes.push( frame );\n\t\t\tframes = frames.concat( comments() );\n\t\t}\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@keyframes missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'keyframes',\n\t\t\tname,\n\t\t\tvendor,\n\t\t\tkeyframes: frames,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse supports.\n\t */\n\n\tfunction atsupports() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@supports *([^{]+)/ );\n\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\tconst supports = trim( m[ 1 ] );\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@supports missing '{'\" );\n\t\t}\n\n\t\tconst style = comments().concat( rules() );\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@supports missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'supports',\n\t\t\tsupports,\n\t\t\trules: style,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse host.\n\t */\n\n\tfunction athost() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@host\\s*/ );\n\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@host missing '{'\" );\n\t\t}\n\n\t\tconst style = comments().concat( rules() );\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@host missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'host',\n\t\t\trules: style,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse media.\n\t */\n\n\tfunction atmedia() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@media *([^{]+)/ );\n\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\tconst media = trim( m[ 1 ] );\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@media missing '{'\" );\n\t\t}\n\n\t\tconst style = comments().concat( rules() );\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@media missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'media',\n\t\t\tmedia,\n\t\t\trules: style,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse container.\n\t */\n\n\tfunction atcontainer() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@container *([^{]+)/ );\n\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\t\tconst container = trim( m[ 1 ] );\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@container missing '{'\" );\n\t\t}\n\n\t\tconst style = comments().concat( rules() );\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@container missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'container',\n\t\t\tcontainer,\n\t\t\trules: style,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse custom-media.\n\t */\n\n\tfunction atcustommedia() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/ );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'custom-media',\n\t\t\tname: trim( m[ 1 ] ),\n\t\t\tmedia: trim( m[ 2 ] ),\n\t\t} );\n\t}\n\n\t/**\n\t * Parse paged media.\n\t */\n\n\tfunction atpage() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@page */ );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst sel = selector() || [];\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@page missing '{'\" );\n\t\t}\n\t\tlet decls = comments();\n\n\t\t// declarations.\n\t\tlet decl;\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( decl = declaration() ) ) {\n\t\t\tdecls.push( decl );\n\t\t\tdecls = decls.concat( comments() );\n\t\t}\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@page missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'page',\n\t\t\tselectors: sel,\n\t\t\tdeclarations: decls,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse document.\n\t */\n\n\tfunction atdocument() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@([-\\w]+)?document *([^{]+)/ );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst vendor = trim( m[ 1 ] );\n\t\tconst doc = trim( m[ 2 ] );\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@document missing '{'\" );\n\t\t}\n\n\t\tconst style = comments().concat( rules() );\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@document missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'document',\n\t\t\tdocument: doc,\n\t\t\tvendor,\n\t\t\trules: style,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse font-face.\n\t */\n\n\tfunction atfontface() {\n\t\tconst pos = position();\n\t\tconst m = match( /^@font-face\\s*/ );\n\t\tif ( ! m ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! open() ) {\n\t\t\treturn error( \"@font-face missing '{'\" );\n\t\t}\n\t\tlet decls = comments();\n\n\t\t// declarations.\n\t\tlet decl;\n\t\t// eslint-disable-next-line no-cond-assign\n\t\twhile ( ( decl = declaration() ) ) {\n\t\t\tdecls.push( decl );\n\t\t\tdecls = decls.concat( comments() );\n\t\t}\n\n\t\tif ( ! close() ) {\n\t\t\treturn error( \"@font-face missing '}'\" );\n\t\t}\n\n\t\treturn pos( {\n\t\t\ttype: 'font-face',\n\t\t\tdeclarations: decls,\n\t\t} );\n\t}\n\n\t/**\n\t * Parse import\n\t */\n\n\tconst atimport = _compileAtrule( 'import' );\n\n\t/**\n\t * Parse charset\n\t */\n\n\tconst atcharset = _compileAtrule( 'charset' );\n\n\t/**\n\t * Parse namespace\n\t */\n\n\tconst atnamespace = _compileAtrule( 'namespace' );\n\n\t/**\n\t * Parse non-block at-rules\n\t */\n\n\tfunction _compileAtrule( name ) {\n\t\tconst re = new RegExp( '^@' + name + '\\\\s*([^;]+);' );\n\t\treturn function () {\n\t\t\tconst pos = position();\n\t\t\tconst m = match( re );\n\t\t\tif ( ! m ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst ret = { type: name };\n\t\t\tret[ name ] = m[ 1 ].trim();\n\t\t\treturn pos( ret );\n\t\t};\n\t}\n\n\t/**\n\t * Parse at rule.\n\t */\n\n\tfunction atrule() {\n\t\tif ( css[ 0 ] !== '@' ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tatkeyframes() ||\n\t\t\tatmedia() ||\n\t\t\tatcontainer() ||\n\t\t\tatcustommedia() ||\n\t\t\tatsupports() ||\n\t\t\tatimport() ||\n\t\t\tatcharset() ||\n\t\t\tatnamespace() ||\n\t\t\tatdocument() ||\n\t\t\tatpage() ||\n\t\t\tathost() ||\n\t\t\tatfontface()\n\t\t);\n\t}\n\n\t/**\n\t * Parse rule.\n\t */\n\n\tfunction rule() {\n\t\tconst pos = position();\n\t\tconst sel = selector();\n\n\t\tif ( ! sel ) {\n\t\t\treturn error( 'selector missing' );\n\t\t}\n\t\tcomments();\n\n\t\treturn pos( {\n\t\t\ttype: 'rule',\n\t\t\tselectors: sel,\n\t\t\tdeclarations: declarations(),\n\t\t} );\n\t}\n\n\treturn addParent( stylesheet() );\n}\n\n/**\n * Trim `str`.\n */\n\nfunction trim( str ) {\n\treturn str ? str.replace( /^\\s+|\\s+$/g, '' ) : '';\n}\n\n/**\n * Adds non-enumerable parent node reference to each node.\n */\n\nfunction addParent( obj, parent ) {\n\tconst isNode = obj && typeof obj.type === 'string';\n\tconst childParent = isNode ? obj : parent;\n\n\tfor ( const k in obj ) {\n\t\tconst value = obj[ k ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\tvalue.forEach( function ( v ) {\n\t\t\t\taddParent( v, childParent );\n\t\t\t} );\n\t\t} else if ( value && typeof value === 'object' ) {\n\t\t\taddParent( value, childParent );\n\t\t}\n\t}\n\n\tif ( isNode ) {\n\t\tObject.defineProperty( obj, 'parent', {\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: parent || null,\n\t\t} );\n\t}\n\n\treturn obj;\n}\n\n/* eslint-enable @wordpress/no-unused-vars-before-return */\n"],"mappings":"AAAA;;AAEA;AACA;;AAEA;AACA;AACA,MAAMA,SAAS,GAAG,iCAAiC;AAEnD,eAAe,UAAWC,GAAG,EAAEC,OAAO,EAAG;EACxCA,OAAO,GAAGA,OAAO,IAAI,CAAC,CAAC;;EAEvB;AACD;AACA;;EAEC,IAAIC,MAAM,GAAG,CAAC;EACd,IAAIC,MAAM,GAAG,CAAC;;EAEd;AACD;AACA;;EAEC,SAASC,cAAcA,CAAEC,GAAG,EAAG;IAC9B,MAAMC,KAAK,GAAGD,GAAG,CAACE,KAAK,CAAE,KAAM,CAAC;IAChC,IAAKD,KAAK,EAAG;MACZJ,MAAM,IAAII,KAAK,CAACE,MAAM;IACvB;IACA,MAAMC,CAAC,GAAGJ,GAAG,CAACK,WAAW,CAAE,IAAK,CAAC;IACjC;IACAP,MAAM,GAAG,CAACM,CAAC,GAAGJ,GAAG,CAACG,MAAM,GAAGC,CAAC,GAAGN,MAAM,GAAGE,GAAG,CAACG,MAAM;EACnD;;EAEA;AACD;AACA;;EAEC,SAASG,QAAQA,CAAA,EAAG;IACnB,MAAMC,KAAK,GAAG;MAAEC,IAAI,EAAEX,MAAM;MAAEC;IAAO,CAAC;IACtC,OAAO,UAAWW,IAAI,EAAG;MACxBA,IAAI,CAACH,QAAQ,GAAG,IAAII,QAAQ,CAAEH,KAAM,CAAC;MACrCI,UAAU,CAAC,CAAC;MACZ,OAAOF,IAAI;IACZ,CAAC;EACF;;EAEA;AACD;AACA;;EAEC,SAASC,QAAQA,CAAEH,KAAK,EAAG;IAC1B,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACK,GAAG,GAAG;MAAEJ,IAAI,EAAEX,MAAM;MAAEC;IAAO,CAAC;IACnC,IAAI,CAACe,MAAM,GAAGjB,OAAO,CAACiB,MAAM;EA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ClD;;AAEA;AACA;AACA;;AAEA,SAAS6C,SAASA,CAAEC,GAAG,EAAEC,MAAM,EAAG;EACjC,MAAMC,MAAM,GAAGF,GAAG,IAAI,OAAOA,GAAG,CAAChE,IAAI,KAAK,QAAQ;EAClD,MAAMmE,WAAW,GAAGD,MAAM,GAAGF,GAAG,GAAGC,MAAM;EAEzC,KAAM,MAAMG,CAAC,IAAIJ,GAAG,EAAG;IACtB,MAAMpC,KAAK,GAAGoC,GAAG,CAAEI,CAAC,CAAE;IACtB,IAAKC,KAAK,CAACC,OAAO,CAAE1C,KAAM,CAAC,EAAG;MAC7BA,KAAK,CAAC2C,OAAO,CAAE,UAAWC,CAAC,EAAG;QAC7BT,SAAS,CAAES,CAAC,EAAEL,WAAY,CAAC;MAC5B,CAAE,CAAC;IACJ,CAAC,MAAM,IAAKvC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAG;MAChDmC,SAAS,CAAEnC,KAAK,EAAEuC,WAAY,CAAC;IAChC;EACD;EAEA,IAAKD,MAAM,EAAG;IACbO,MAAM,CAACC,cAAc,CAAEV,GAAG,EAAE,QAAQ,EAAE;MACrCW,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,IAAI;MACdC,UAAU,EAAE,KAAK;MACjBjD,KAAK,EAAEqC,MAAM,IAAI;IAClB,CAAE,CAAC;EACJ;EAEA,OAAOD,GAAG;AACX;;AAEA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Adapted from https://github.com/reworkcss/css
|
|
2
|
-
// because we needed to remove source map support.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Expose `Compiler`.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export default Compiler;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Initialize a compiler.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
function Compiler(opts) {
|
|
15
|
-
this.options = opts || {};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Emit `str`
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
Compiler.prototype.emit = function (str) {
|
|
23
|
-
return str;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Visit `node`.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
Compiler.prototype.visit = function (node) {
|
|
31
|
-
return this[node.type](node);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Map visit over array of `nodes`, optionally using a `delim`
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
Compiler.prototype.mapVisit = function (nodes, delim) {
|
|
39
|
-
let buf = '';
|
|
40
|
-
delim = delim || '';
|
|
41
|
-
for (let i = 0, length = nodes.length; i < length; i++) {
|
|
42
|
-
buf += this.visit(nodes[i]);
|
|
43
|
-
if (delim && i < length - 1) {
|
|
44
|
-
buf += this.emit(delim);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return buf;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=compiler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Compiler","opts","options","prototype","emit","str","visit","node","type","mapVisit","nodes","delim","buf","i","length"],"sources":["@wordpress/block-editor/src/utils/transform-styles/ast/stringify/compiler.js"],"sourcesContent":["// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\n/**\n * Expose `Compiler`.\n */\n\nexport default Compiler;\n\n/**\n * Initialize a compiler.\n */\n\nfunction Compiler( opts ) {\n\tthis.options = opts || {};\n}\n\n/**\n * Emit `str`\n */\n\nCompiler.prototype.emit = function ( str ) {\n\treturn str;\n};\n\n/**\n * Visit `node`.\n */\n\nCompiler.prototype.visit = function ( node ) {\n\treturn this[ node.type ]( node );\n};\n\n/**\n * Map visit over array of `nodes`, optionally using a `delim`\n */\n\nCompiler.prototype.mapVisit = function ( nodes, delim ) {\n\tlet buf = '';\n\tdelim = delim || '';\n\n\tfor ( let i = 0, length = nodes.length; i < length; i++ ) {\n\t\tbuf += this.visit( nodes[ i ] );\n\t\tif ( delim && i < length - 1 ) {\n\t\t\tbuf += this.emit( delim );\n\t\t}\n\t}\n\n\treturn buf;\n};\n"],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;;AAEA,eAAeA,QAAQ;;AAEvB;AACA;AACA;;AAEA,SAASA,QAAQA,CAAEC,IAAI,EAAG;EACzB,IAAI,CAACC,OAAO,GAAGD,IAAI,IAAI,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;;AAEAD,QAAQ,CAACG,SAAS,CAACC,IAAI,GAAG,UAAWC,GAAG,EAAG;EAC1C,OAAOA,GAAG;AACX,CAAC;;AAED;AACA;AACA;;AAEAL,QAAQ,CAACG,SAAS,CAACG,KAAK,GAAG,UAAWC,IAAI,EAAG;EAC5C,OAAO,IAAI,CAAEA,IAAI,CAACC,IAAI,CAAE,CAAED,IAAK,CAAC;AACjC,CAAC;;AAED;AACA;AACA;;AAEAP,QAAQ,CAACG,SAAS,CAACM,QAAQ,GAAG,UAAWC,KAAK,EAAEC,KAAK,EAAG;EACvD,IAAIC,GAAG,GAAG,EAAE;EACZD,KAAK,GAAGA,KAAK,IAAI,EAAE;EAEnB,KAAM,IAAIE,CAAC,GAAG,CAAC,EAAEC,MAAM,GAAGJ,KAAK,CAACI,MAAM,EAAED,CAAC,GAAGC,MAAM,EAAED,CAAC,EAAE,EAAG;IACzDD,GAAG,IAAI,IAAI,CAACN,KAAK,CAAEI,KAAK,CAAEG,CAAC,CAAG,CAAC;IAC/B,IAAKF,KAAK,IAAIE,CAAC,GAAGC,MAAM,GAAG,CAAC,EAAG;MAC9BF,GAAG,IAAI,IAAI,CAACR,IAAI,CAAEO,KAAM,CAAC;IAC1B;EACD;EAEA,OAAOC,GAAG;AACX,CAAC"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
// Adapted from https://github.com/reworkcss/css
|
|
2
|
-
// because we needed to remove source map support.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import inherits from 'inherits';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import Base from './compiler';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Expose compiler.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export default Compiler;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Initialize a new `Compiler`.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function Compiler(options) {
|
|
25
|
-
Base.call(this, options);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Inherit from `Base.prototype`.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
inherits(Compiler, Base);
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Compile `node`.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
Compiler.prototype.compile = function (node) {
|
|
39
|
-
return node.stylesheet.rules.map(this.visit, this).join('');
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Visit comment node.
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
Compiler.prototype.comment = function (node) {
|
|
47
|
-
return this.emit('', node.position);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Visit import node.
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
Compiler.prototype.import = function (node) {
|
|
55
|
-
return this.emit('@import ' + node.import + ';', node.position);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Visit media node.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
Compiler.prototype.media = function (node) {
|
|
63
|
-
return this.emit('@media ' + node.media, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Visit container node.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
Compiler.prototype.container = function (node) {
|
|
71
|
-
return this.emit('@container ' + node.container, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Visit document node.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
Compiler.prototype.document = function (node) {
|
|
79
|
-
const doc = '@' + (node.vendor || '') + 'document ' + node.document;
|
|
80
|
-
return this.emit(doc, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Visit charset node.
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
Compiler.prototype.charset = function (node) {
|
|
88
|
-
return this.emit('@charset ' + node.charset + ';', node.position);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Visit namespace node.
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
Compiler.prototype.namespace = function (node) {
|
|
96
|
-
return this.emit('@namespace ' + node.namespace + ';', node.position);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Visit supports node.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
Compiler.prototype.supports = function (node) {
|
|
104
|
-
return this.emit('@supports ' + node.supports, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Visit keyframes node.
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
Compiler.prototype.keyframes = function (node) {
|
|
112
|
-
return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit('{') + this.mapVisit(node.keyframes) + this.emit('}');
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Visit keyframe node.
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
Compiler.prototype.keyframe = function (node) {
|
|
120
|
-
const decls = node.declarations;
|
|
121
|
-
return this.emit(node.values.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Visit page node.
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
Compiler.prototype.page = function (node) {
|
|
129
|
-
const sel = node.selectors.length ? node.selectors.join(', ') : '';
|
|
130
|
-
return this.emit('@page ' + sel, node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Visit font-face node.
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
Compiler.prototype['font-face'] = function (node) {
|
|
138
|
-
return this.emit('@font-face', node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Visit host node.
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
Compiler.prototype.host = function (node) {
|
|
146
|
-
return this.emit('@host', node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Visit custom-media node.
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
Compiler.prototype['custom-media'] = function (node) {
|
|
154
|
-
return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Visit rule node.
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
Compiler.prototype.rule = function (node) {
|
|
162
|
-
const decls = node.declarations;
|
|
163
|
-
if (!decls.length) {
|
|
164
|
-
return '';
|
|
165
|
-
}
|
|
166
|
-
return this.emit(node.selectors.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Visit declaration node.
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
Compiler.prototype.declaration = function (node) {
|
|
174
|
-
return this.emit(node.property + ':' + node.value, node.position) + this.emit(';');
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=compress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["inherits","Base","Compiler","options","call","prototype","compile","node","stylesheet","rules","map","visit","join","comment","emit","position","import","media","mapVisit","container","document","doc","vendor","charset","namespace","supports","keyframes","name","keyframe","decls","declarations","values","page","sel","selectors","length","host","rule","declaration","property","value"],"sources":["@wordpress/block-editor/src/utils/transform-styles/ast/stringify/compress.js"],"sourcesContent":["// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\n/**\n * External dependencies\n */\nimport inherits from 'inherits';\n\n/**\n * Internal dependencies\n */\nimport Base from './compiler';\n\n/**\n * Expose compiler.\n */\n\nexport default Compiler;\n\n/**\n * Initialize a new `Compiler`.\n */\n\nfunction Compiler( options ) {\n\tBase.call( this, options );\n}\n\n/**\n * Inherit from `Base.prototype`.\n */\n\ninherits( Compiler, Base );\n\n/**\n * Compile `node`.\n */\n\nCompiler.prototype.compile = function ( node ) {\n\treturn node.stylesheet.rules.map( this.visit, this ).join( '' );\n};\n\n/**\n * Visit comment node.\n */\n\nCompiler.prototype.comment = function ( node ) {\n\treturn this.emit( '', node.position );\n};\n\n/**\n * Visit import node.\n */\n\nCompiler.prototype.import = function ( node ) {\n\treturn this.emit( '@import ' + node.import + ';', node.position );\n};\n\n/**\n * Visit media node.\n */\n\nCompiler.prototype.media = function ( node ) {\n\treturn (\n\t\tthis.emit( '@media ' + node.media, node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.rules ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit container node.\n */\n\nCompiler.prototype.container = function ( node ) {\n\treturn (\n\t\tthis.emit( '@container ' + node.container, node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.rules ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit document node.\n */\n\nCompiler.prototype.document = function ( node ) {\n\tconst doc = '@' + ( node.vendor || '' ) + 'document ' + node.document;\n\n\treturn (\n\t\tthis.emit( doc, node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.rules ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit charset node.\n */\n\nCompiler.prototype.charset = function ( node ) {\n\treturn this.emit( '@charset ' + node.charset + ';', node.position );\n};\n\n/**\n * Visit namespace node.\n */\n\nCompiler.prototype.namespace = function ( node ) {\n\treturn this.emit( '@namespace ' + node.namespace + ';', node.position );\n};\n\n/**\n * Visit supports node.\n */\n\nCompiler.prototype.supports = function ( node ) {\n\treturn (\n\t\tthis.emit( '@supports ' + node.supports, node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.rules ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit keyframes node.\n */\n\nCompiler.prototype.keyframes = function ( node ) {\n\treturn (\n\t\tthis.emit(\n\t\t\t'@' + ( node.vendor || '' ) + 'keyframes ' + node.name,\n\t\t\tnode.position\n\t\t) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.keyframes ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit keyframe node.\n */\n\nCompiler.prototype.keyframe = function ( node ) {\n\tconst decls = node.declarations;\n\n\treturn (\n\t\tthis.emit( node.values.join( ',' ), node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( decls ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit page node.\n */\n\nCompiler.prototype.page = function ( node ) {\n\tconst sel = node.selectors.length ? node.selectors.join( ', ' ) : '';\n\n\treturn (\n\t\tthis.emit( '@page ' + sel, node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.declarations ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit font-face node.\n */\n\nCompiler.prototype[ 'font-face' ] = function ( node ) {\n\treturn (\n\t\tthis.emit( '@font-face', node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.declarations ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit host node.\n */\n\nCompiler.prototype.host = function ( node ) {\n\treturn (\n\t\tthis.emit( '@host', node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( node.rules ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit custom-media node.\n */\n\nCompiler.prototype[ 'custom-media' ] = function ( node ) {\n\treturn this.emit(\n\t\t'@custom-media ' + node.name + ' ' + node.media + ';',\n\t\tnode.position\n\t);\n};\n\n/**\n * Visit rule node.\n */\n\nCompiler.prototype.rule = function ( node ) {\n\tconst decls = node.declarations;\n\tif ( ! decls.length ) {\n\t\treturn '';\n\t}\n\n\treturn (\n\t\tthis.emit( node.selectors.join( ',' ), node.position ) +\n\t\tthis.emit( '{' ) +\n\t\tthis.mapVisit( decls ) +\n\t\tthis.emit( '}' )\n\t);\n};\n\n/**\n * Visit declaration node.\n */\n\nCompiler.prototype.declaration = function ( node ) {\n\treturn (\n\t\tthis.emit( node.property + ':' + node.value, node.position ) +\n\t\tthis.emit( ';' )\n\t);\n};\n"],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,UAAU;;AAE/B;AACA;AACA;AACA,OAAOC,IAAI,MAAM,YAAY;;AAE7B;AACA;AACA;;AAEA,eAAeC,QAAQ;;AAEvB;AACA;AACA;;AAEA,SAASA,QAAQA,CAAEC,OAAO,EAAG;EAC5BF,IAAI,CAACG,IAAI,CAAE,IAAI,EAAED,OAAQ,CAAC;AAC3B;;AAEA;AACA;AAC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I,CAAC,EAAEL,IAAI,CAACQ,QAAS,CAAC,GACtD,IAAI,CAACD,IAAI,CAAE,GAAI,CAAC,GAChB,IAAI,CAACI,QAAQ,CAAEW,KAAM,CAAC,GACtB,IAAI,CAACf,IAAI,CAAE,GAAI,CAAC;AAElB,CAAC;;AAED;AACA;AACA;;AAEAZ,QAAQ,CAACG,SAAS,CAACiC,WAAW,GAAG,UAAW/B,IAAI,EAAG;EAClD,OACC,IAAI,CAACO,IAAI,CAAEP,IAAI,CAACgC,QAAQ,GAAG,GAAG,GAAGhC,IAAI,CAACiC,KAAK,EAAEjC,IAAI,CAACQ,QAAS,CAAC,GAC5D,IAAI,CAACD,IAAI,CAAE,GAAI,CAAC;AAElB,CAAC"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @wordpress/no-unused-vars-before-return */
|
|
2
|
-
|
|
3
|
-
// Adapted from https://github.com/reworkcss/css
|
|
4
|
-
// because we needed to remove source map support.
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
|
-
import inherits from 'inherits';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import Base from './compiler';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Expose compiler.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export default Compiler;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Initialize a new `Compiler`.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
function Compiler(options) {
|
|
27
|
-
options = options || {};
|
|
28
|
-
Base.call(this, options);
|
|
29
|
-
this.indentation = options.indent;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Inherit from `Base.prototype`.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
inherits(Compiler, Base);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Compile `node`.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
Compiler.prototype.compile = function (node) {
|
|
43
|
-
return this.stylesheet(node);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Visit stylesheet node.
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
Compiler.prototype.stylesheet = function (node) {
|
|
51
|
-
return this.mapVisit(node.stylesheet.rules, '\n\n');
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Visit comment node.
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
Compiler.prototype.comment = function (node) {
|
|
59
|
-
return this.emit(this.indent() + '/*' + node.comment + '*/', node.position);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Visit import node.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
Compiler.prototype.import = function (node) {
|
|
67
|
-
return this.emit('@import ' + node.import + ';', node.position);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Visit media node.
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
Compiler.prototype.media = function (node) {
|
|
75
|
-
return this.emit('@media ' + node.media, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Visit container node.
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
Compiler.prototype.container = function (node) {
|
|
83
|
-
return this.emit('@container ' + node.container, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Visit document node.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
Compiler.prototype.document = function (node) {
|
|
91
|
-
const doc = '@' + (node.vendor || '') + 'document ' + node.document;
|
|
92
|
-
return this.emit(doc, node.position) + this.emit(' ' + ' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Visit charset node.
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
Compiler.prototype.charset = function (node) {
|
|
100
|
-
return this.emit('@charset ' + node.charset + ';', node.position);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Visit namespace node.
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
Compiler.prototype.namespace = function (node) {
|
|
108
|
-
return this.emit('@namespace ' + node.namespace + ';', node.position);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Visit supports node.
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
Compiler.prototype.supports = function (node) {
|
|
116
|
-
return this.emit('@supports ' + node.supports, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Visit keyframes node.
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
Compiler.prototype.keyframes = function (node) {
|
|
124
|
-
return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.keyframes, '\n') + this.emit(this.indent(-1) + '}');
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Visit keyframe node.
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
Compiler.prototype.keyframe = function (node) {
|
|
132
|
-
const decls = node.declarations;
|
|
133
|
-
return this.emit(this.indent()) + this.emit(node.values.join(', '), node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1) + '\n' + this.indent() + '}\n');
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Visit page node.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
Compiler.prototype.page = function (node) {
|
|
141
|
-
const sel = node.selectors.length ? node.selectors.join(', ') + ' ' : '';
|
|
142
|
-
return this.emit('@page ' + sel, node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Visit font-face node.
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
Compiler.prototype['font-face'] = function (node) {
|
|
150
|
-
return this.emit('@font-face ', node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Visit host node.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
Compiler.prototype.host = function (node) {
|
|
158
|
-
return this.emit('@host', node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Visit custom-media node.
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
Compiler.prototype['custom-media'] = function (node) {
|
|
166
|
-
return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Visit rule node.
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
Compiler.prototype.rule = function (node) {
|
|
174
|
-
const indent = this.indent();
|
|
175
|
-
const decls = node.declarations;
|
|
176
|
-
if (!decls.length) {
|
|
177
|
-
return '';
|
|
178
|
-
}
|
|
179
|
-
return this.emit(node.selectors.map(function (s) {
|
|
180
|
-
return indent + s;
|
|
181
|
-
}).join(',\n'), node.position) + this.emit(' {\n') + this.emit(this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1)) + this.emit('\n' + this.indent() + '}');
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Visit declaration node.
|
|
186
|
-
*/
|
|
187
|
-
|
|
188
|
-
Compiler.prototype.declaration = function (node) {
|
|
189
|
-
return this.emit(this.indent()) + this.emit(node.property + ': ' + node.value, node.position) + this.emit(';');
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Increase, decrease or return current indentation.
|
|
194
|
-
*/
|
|
195
|
-
|
|
196
|
-
Compiler.prototype.indent = function (level) {
|
|
197
|
-
this.level = this.level || 1;
|
|
198
|
-
if (null !== level) {
|
|
199
|
-
this.level += level;
|
|
200
|
-
return '';
|
|
201
|
-
}
|
|
202
|
-
return Array(this.level).join(this.indentation || ' ');
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/* eslint-enable @wordpress/no-unused-vars-before-return */
|
|
206
|
-
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["inherits","Base","Compiler","options","call","indentation","indent","prototype","compile","node","stylesheet","mapVisit","rules","comment","emit","position","import","media","container","document","doc","vendor","charset","namespace","supports","keyframes","name","keyframe","decls","declarations","values","join","page","sel","selectors","length","host","rule","map","s","declaration","property","value","level","Array"],"sources":["@wordpress/block-editor/src/utils/transform-styles/ast/stringify/identity.js"],"sourcesContent":["/* eslint-disable @wordpress/no-unused-vars-before-return */\n\n// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\n/**\n * External dependencies\n */\nimport inherits from 'inherits';\n\n/**\n * Internal dependencies\n */\nimport Base from './compiler';\n\n/**\n * Expose compiler.\n */\n\nexport default Compiler;\n\n/**\n * Initialize a new `Compiler`.\n */\n\nfunction Compiler( options ) {\n\toptions = options || {};\n\tBase.call( this, options );\n\tthis.indentation = options.indent;\n}\n\n/**\n * Inherit from `Base.prototype`.\n */\n\ninherits( Compiler, Base );\n\n/**\n * Compile `node`.\n */\n\nCompiler.prototype.compile = function ( node ) {\n\treturn this.stylesheet( node );\n};\n\n/**\n * Visit stylesheet node.\n */\n\nCompiler.prototype.stylesheet = function ( node ) {\n\treturn this.mapVisit( node.stylesheet.rules, '\\n\\n' );\n};\n\n/**\n * Visit comment node.\n */\n\nCompiler.prototype.comment = function ( node ) {\n\treturn this.emit(\n\t\tthis.indent() + '/*' + node.comment + '*/',\n\t\tnode.position\n\t);\n};\n\n/**\n * Visit import node.\n */\n\nCompiler.prototype.import = function ( node ) {\n\treturn this.emit( '@import ' + node.import + ';', node.position );\n};\n\n/**\n * Visit media node.\n */\n\nCompiler.prototype.media = function ( node ) {\n\treturn (\n\t\tthis.emit( '@media ' + node.media, node.position ) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.rules, '\\n\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n}' )\n\t);\n};\n\n/**\n * Visit container node.\n */\n\nCompiler.prototype.container = function ( node ) {\n\treturn (\n\t\tthis.emit( '@container ' + node.container, node.position ) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.rules, '\\n\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n}' )\n\t);\n};\n\n/**\n * Visit document node.\n */\n\nCompiler.prototype.document = function ( node ) {\n\tconst doc = '@' + ( node.vendor || '' ) + 'document ' + node.document;\n\n\treturn (\n\t\tthis.emit( doc, node.position ) +\n\t\tthis.emit( ' ' + ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.rules, '\\n\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n}' )\n\t);\n};\n\n/**\n * Visit charset node.\n */\n\nCompiler.prototype.charset = function ( node ) {\n\treturn this.emit( '@charset ' + node.charset + ';', node.position );\n};\n\n/**\n * Visit namespace node.\n */\n\nCompiler.prototype.namespace = function ( node ) {\n\treturn this.emit( '@namespace ' + node.namespace + ';', node.position );\n};\n\n/**\n * Visit supports node.\n */\n\nCompiler.prototype.supports = function ( node ) {\n\treturn (\n\t\tthis.emit( '@supports ' + node.supports, node.position ) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.rules, '\\n\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n}' )\n\t);\n};\n\n/**\n * Visit keyframes node.\n */\n\nCompiler.prototype.keyframes = function ( node ) {\n\treturn (\n\t\tthis.emit(\n\t\t\t'@' + ( node.vendor || '' ) + 'keyframes ' + node.name,\n\t\t\tnode.position\n\t\t) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.keyframes, '\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '}' )\n\t);\n};\n\n/**\n * Visit keyframe node.\n */\n\nCompiler.prototype.keyframe = function ( node ) {\n\tconst decls = node.declarations;\n\n\treturn (\n\t\tthis.emit( this.indent() ) +\n\t\tthis.emit( node.values.join( ', ' ), node.position ) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( decls, '\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n' + this.indent() + '}\\n' )\n\t);\n};\n\n/**\n * Visit page node.\n */\n\nCompiler.prototype.page = function ( node ) {\n\tconst sel = node.selectors.length ? node.selectors.join( ', ' ) + ' ' : '';\n\n\treturn (\n\t\tthis.emit( '@page ' + sel, node.position ) +\n\t\tthis.emit( '{\\n' ) +\n\t\tthis.emit( this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.declarations, '\\n' ) +\n\t\tthis.emit( this.indent( -1 ) ) +\n\t\tthis.emit( '\\n}' )\n\t);\n};\n\n/**\n * Visit font-face node.\n */\n\nCompiler.prototype[ 'font-face' ] = function ( node ) {\n\treturn (\n\t\tthis.emit( '@font-face ', node.position ) +\n\t\tthis.emit( '{\\n' ) +\n\t\tthis.emit( this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.declarations, '\\n' ) +\n\t\tthis.emit( this.indent( -1 ) ) +\n\t\tthis.emit( '\\n}' )\n\t);\n};\n\n/**\n * Visit host node.\n */\n\nCompiler.prototype.host = function ( node ) {\n\treturn (\n\t\tthis.emit( '@host', node.position ) +\n\t\tthis.emit( ' {\\n' + this.indent( 1 ) ) +\n\t\tthis.mapVisit( node.rules, '\\n\\n' ) +\n\t\tthis.emit( this.indent( -1 ) + '\\n}' )\n\t);\n};\n\n/**\n * Visit custom-media node.\n */\n\nCompiler.prototype[ 'custom-media' ] = function ( node ) {\n\treturn this.emit(\n\t\t'@custom-media ' + node.name + ' ' + node.media + ';',\n\t\tnode.position\n\t);\n};\n\n/**\n * Visit rule node.\n */\n\nCompiler.prototype.rule = function ( node ) {\n\tconst indent = this.indent();\n\tconst decls = node.declarations;\n\tif ( ! decls.length ) {\n\t\treturn '';\n\t}\n\n\treturn (\n\t\tthis.emit(\n\t\t\tnode.selectors\n\t\t\t\t.map( function ( s ) {\n\t\t\t\t\treturn indent + s;\n\t\t\t\t} )\n\t\t\t\t.join( ',\\n' ),\n\t\t\tnode.position\n\t\t) +\n\t\tthis.emit( ' {\\n' ) +\n\t\tthis.emit( this.indent( 1 ) ) +\n\t\tthis.mapVisit( decls, '\\n' ) +\n\t\tthis.emit( this.indent( -1 ) ) +\n\t\tthis.emit( '\\n' + this.indent() + '}' )\n\t);\n};\n\n/**\n * Visit declaration node.\n */\n\nCompiler.prototype.declaration = function ( node ) {\n\treturn (\n\t\tthis.emit( this.indent() ) +\n\t\tthis.emit( node.property + ': ' + node.value, node.position ) +\n\t\tthis.emit( ';' )\n\t);\n};\n\n/**\n * Increase, decrease or return current indentation.\n */\n\nCompiler.prototype.indent = function ( level ) {\n\tthis.level = this.level || 1;\n\n\tif ( null !== level ) {\n\t\tthis.level += level;\n\t\treturn '';\n\t}\n\n\treturn Array( this.level ).join( this.indentation || ' ' );\n};\n\n/* eslint-enable @wordpress/no-unused-vars-before-return */\n"],"mappings":"AAAA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,UAAU;;AAE/B;AACA;AACA;AACA,OAAOC,IAAI,MAAM,YAAY;;AAE7B;AACA;AACA;;AAEA,eAAeC,QAAQ;;AAEvB;AACA;AACA;;AAEA,SAASA,QAAQA,CAAEC,OAAO,EAAG;EAC5BA,OAAO,GAAGA,OAAO,IAAI,CAAC,CAAC;EACvBF,IAAI,CAACG,IAAI,CAAE,IAAI,EAAED,OAAQ,CAAC;EAC1B,IAAI,CAACE,WAAW,GAAGF,OAAO,CAACG,MAAM;AAClC;;AAEA;AACA;AACA;;AAEAN,QAAQ,CAAEE,QAAQ,EAAED,IAAK,CAAC;;AAE1B;AACA;AACA;;AAEAC,QAAQ,CAACK,SAAS,CAACC,OAAO,GAAG,UAAWC,IAAI,EAAG;EAC9C,OAAO,IAAI,CAACC,UAAU,CAAED,IAAK,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;;AAEAP,QAAQ,CAACK,SAAS,CAACG,UAAU,GAAG,UAAWD,IAAI,EAAG;EACjD,OAAO,IAAI,CAACE,QAAQ,CAAEF,IAAI,CAACC,UAAU,CAACE,KAAK,EAAE,MAAO,CAAC;AACtD,CAAC;;AAED;AACA;AACA;;AAEAV,QAAQ,CAACK,SAAS,CAACM,OAAO,GAAG,UAAWJ,IAAI,EAAG;EAC9C,OAAO,IAAI,CAACK,IAAI,CACf,IAAI,CAACR,MAAM,CAAC,CAAC,GAAG,IAAI,GAAGG,IAAI,CAACI,OAAO,GAAG,IAAI,EAC1CJ,IAAI,CAACM,QACN,CAAC;AACF,CAAC;;AAED;AACA;AACA;;AAEAb,QAAQ,CAACK,SAAS,CAACS,MAAM,GAAG,UAAWP,IAAI,EAAG;EAC7C,OAAO,IAAI,CAACK,IAAI,CAAE,UAAU,GAAGL,IAAI,CA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AI,CAACR,MAAM,CAAC,CAAE,CAAC,GAC1B,IAAI,CAACQ,IAAI,CAAEL,IAAI,CAACgC,QAAQ,GAAG,IAAI,GAAGhC,IAAI,CAACiC,KAAK,EAAEjC,IAAI,CAACM,QAAS,CAAC,GAC7D,IAAI,CAACD,IAAI,CAAE,GAAI,CAAC;AAElB,CAAC;;AAED;AACA;AACA;;AAEAZ,QAAQ,CAACK,SAAS,CAACD,MAAM,GAAG,UAAWqC,KAAK,EAAG;EAC9C,IAAI,CAACA,KAAK,GAAG,IAAI,CAACA,KAAK,IAAI,CAAC;EAE5B,IAAK,IAAI,KAAKA,KAAK,EAAG;IACrB,IAAI,CAACA,KAAK,IAAIA,KAAK;IACnB,OAAO,EAAE;EACV;EAEA,OAAOC,KAAK,CAAE,IAAI,CAACD,KAAM,CAAC,CAACZ,IAAI,CAAE,IAAI,CAAC1B,WAAW,IAAI,IAAK,CAAC;AAC5D,CAAC;;AAED"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Adapted from https://github.com/reworkcss/css
|
|
2
|
-
// because we needed to remove source map support.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Internal dependencies
|
|
6
|
-
*/
|
|
7
|
-
import Compressed from './compress';
|
|
8
|
-
import Identity from './identity';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Stringfy the given AST `node`.
|
|
12
|
-
*
|
|
13
|
-
* Options:
|
|
14
|
-
*
|
|
15
|
-
* - `compress` space-optimized output
|
|
16
|
-
* - `sourcemap` return an object with `.code` and `.map`
|
|
17
|
-
*
|
|
18
|
-
* @param {Object} node
|
|
19
|
-
* @param {Object} [options]
|
|
20
|
-
* @return {string}
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export default function (node, options) {
|
|
24
|
-
options = options || {};
|
|
25
|
-
const compiler = options.compress ? new Compressed(options) : new Identity(options);
|
|
26
|
-
const code = compiler.compile(node);
|
|
27
|
-
return code;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Compressed","Identity","node","options","compiler","compress","code","compile"],"sources":["@wordpress/block-editor/src/utils/transform-styles/ast/stringify/index.js"],"sourcesContent":["// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\n/**\n * Internal dependencies\n */\nimport Compressed from './compress';\nimport Identity from './identity';\n\n/**\n * Stringfy the given AST `node`.\n *\n * Options:\n *\n * - `compress` space-optimized output\n * - `sourcemap` return an object with `.code` and `.map`\n *\n * @param {Object} node\n * @param {Object} [options]\n * @return {string}\n */\n\nexport default function ( node, options ) {\n\toptions = options || {};\n\n\tconst compiler = options.compress\n\t\t? new Compressed( options )\n\t\t: new Identity( options );\n\n\tconst code = compiler.compile( node );\n\treturn code;\n}\n"],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,YAAY;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,UAAWC,IAAI,EAAEC,OAAO,EAAG;EACzCA,OAAO,GAAGA,OAAO,IAAI,CAAC,CAAC;EAEvB,MAAMC,QAAQ,GAAGD,OAAO,CAACE,QAAQ,GAC9B,IAAIL,UAAU,CAAEG,OAAQ,CAAC,GACzB,IAAIF,QAAQ,CAAEE,OAAQ,CAAC;EAE1B,MAAMG,IAAI,GAAGF,QAAQ,CAACG,OAAO,CAAEL,IAAK,CAAC;EACrC,OAAOI,IAAI;AACZ"}
|