@wordpress/components
Version:
UI components for WordPress.
1 lines • 21.8 kB
Source Map (JSON)
{"version":3,"file":"hook.cjs","names":["useContextSystem","createHighlighterText","useMemo","getOptimalTextShade","getFontSize","styles","useTruncate","Children","hasConnectNamespace","cloneElement"],"sources":["../../../style-runtime/src/index.ts","../../src/text/style.module.scss","../../src/text/hook.ts"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e27a9e3ac6\", \"._9adcfccb60b2247a__text{--wp-components-text-color:initial;--wp-components-text-display:initial;--wp-components-text-font-size:initial;--wp-components-text-font-weight:initial;--wp-components-text-line-height:initial;--wp-components-text-letter-spacing:initial;--wp-components-text-text-align:initial;color:var(--wp-components-text-color,var(--wp-components-color-foreground,var(--wpds-color-foreground-content-neutral,#1e1e1e)));font-size:var(--wp-components-text-font-size);font-weight:var(--wp-components-text-font-weight);line-height:var(--wp-components-text-line-height,1.4);margin:0}.be2801831b79afba__control-line-height{--wp-components-text-line-height:44px}._2766c02d4e2af624__control-line-height-large{--wp-components-text-line-height:51.2px}._9e9a12b52be6eaa6__control-line-height-small{--wp-components-text-line-height:36.8px}._9679ea4f8130b41b__control-line-height-xSmall{--wp-components-text-line-height:29.6px}:where(._9adcfccb60b2247a__text){text-wrap:pretty}.c60c92f64a762322__has-display{display:var(--wp-components-text-display)}.b175e6c806c12b91__has-letter-spacing{letter-spacing:var(--wp-components-text-letter-spacing)}._61d26f9e5a24b029__has-text-align{text-align:var(--wp-components-text-text-align)}._62c63396e878c636__color-inherit{color:inherit}.fa1a366a0316de8a__color-initial{color:initial}.bedd7276c2009829__color-unset{color:unset}._3d00572545c63e6a__color-revert{color:revert}._4dacbd11c988fe99__color-revert-layer{color:revert-layer}._5e040fbfaf4f4d38__display-inherit{display:inherit}._7220342a95fdd85c__display-initial{display:initial}.e20489bdd99704f2__display-unset{display:unset}.b5f39b2366b6dffe__display-revert{display:revert}.cf965ed661ac7fb2__display-revert-layer{display:revert-layer}._0f1f78c473941cbe__font-size-inherit{font-size:inherit}.a93c3905fbfc11bc__font-size-initial{font-size:medium}._1e50723f80ef5d43__font-size-unset{font-size:unset}.a95b24f6b61444bd__font-size-revert{font-size:revert}._2079c077bf1fbdcf__font-size-revert-layer{font-size:revert-layer}.d0d698763b755384__font-weight-inherit{font-weight:inherit}._13163ec25c4af630__font-weight-initial{font-weight:400}._8f72ce3ee1e025ad__font-weight-unset{font-weight:unset}._37b153dc1dea90f6__font-weight-revert{font-weight:revert}.f404e4e0bf4855e5__font-weight-revert-layer{font-weight:revert-layer}._9b78387743829f99__line-height-inherit{line-height:inherit}._8a98bdbfcd1d3306__line-height-initial{line-height:normal}._32bcd8dbe349bf0f__line-height-unset{line-height:unset}.b4012a1a310357f4__line-height-revert{line-height:revert}.ff2ef4eddcb6e028__line-height-revert-layer{line-height:revert-layer}._235241409a6f8103__letter-spacing-inherit{letter-spacing:inherit}.d860cf0adfc31190__letter-spacing-initial{letter-spacing:normal}.abadaec0a0ceadbf__letter-spacing-unset{letter-spacing:unset}.d6fb6f3766caddb2__letter-spacing-revert{letter-spacing:revert}._00768243984a3b13__letter-spacing-revert-layer{letter-spacing:revert-layer}._82d28f4984b6a9f7__text-align-inherit{text-align:inherit}._799255031fe610e4__text-align-initial{text-align:initial}.b1ee967d38e16fec__text-align-unset{text-align:unset}._6fc3935d62ac2f4e__text-align-revert{text-align:revert}._523bd3263fe71193__text-align-revert-layer{text-align:revert-layer}._7c2beb4bab7d50b1__readability-dark{color:#1e1e1e}._69065619bb900bef__readability-light{color:#fff}._72e2728c12780836__destructive{color:#d94f4f}._5319770adc3fb346__highlighter-text mark{background:#f0b849;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.05),inset 0 -1px 0 rgba(0,0,0,.1)}._739dffda40610a31__block{display:block}.dcc48a33948e2e77__muted{color:var(--wp-components-color-gray-700,var(--wpds-color-foreground-content-neutral-weak,#6e6e6e))}._813d9e8ef49f4085__upper-case{text-transform:uppercase}\");\n}\nexport default {\"text\":\"_9adcfccb60b2247a__text\",\"control-line-height\":\"be2801831b79afba__control-line-height\",\"control-line-height-large\":\"_2766c02d4e2af624__control-line-height-large\",\"control-line-height-small\":\"_9e9a12b52be6eaa6__control-line-height-small\",\"control-line-height-xSmall\":\"_9679ea4f8130b41b__control-line-height-xSmall\",\"has-display\":\"c60c92f64a762322__has-display\",\"has-letter-spacing\":\"b175e6c806c12b91__has-letter-spacing\",\"has-text-align\":\"_61d26f9e5a24b029__has-text-align\",\"color-inherit\":\"_62c63396e878c636__color-inherit\",\"color-initial\":\"fa1a366a0316de8a__color-initial\",\"color-unset\":\"bedd7276c2009829__color-unset\",\"color-revert\":\"_3d00572545c63e6a__color-revert\",\"color-revert-layer\":\"_4dacbd11c988fe99__color-revert-layer\",\"display-inherit\":\"_5e040fbfaf4f4d38__display-inherit\",\"display-initial\":\"_7220342a95fdd85c__display-initial\",\"display-unset\":\"e20489bdd99704f2__display-unset\",\"display-revert\":\"b5f39b2366b6dffe__display-revert\",\"display-revert-layer\":\"cf965ed661ac7fb2__display-revert-layer\",\"font-size-inherit\":\"_0f1f78c473941cbe__font-size-inherit\",\"font-size-initial\":\"a93c3905fbfc11bc__font-size-initial\",\"font-size-unset\":\"_1e50723f80ef5d43__font-size-unset\",\"font-size-revert\":\"a95b24f6b61444bd__font-size-revert\",\"font-size-revert-layer\":\"_2079c077bf1fbdcf__font-size-revert-layer\",\"font-weight-inherit\":\"d0d698763b755384__font-weight-inherit\",\"font-weight-initial\":\"_13163ec25c4af630__font-weight-initial\",\"font-weight-unset\":\"_8f72ce3ee1e025ad__font-weight-unset\",\"font-weight-revert\":\"_37b153dc1dea90f6__font-weight-revert\",\"font-weight-revert-layer\":\"f404e4e0bf4855e5__font-weight-revert-layer\",\"line-height-inherit\":\"_9b78387743829f99__line-height-inherit\",\"line-height-initial\":\"_8a98bdbfcd1d3306__line-height-initial\",\"line-height-unset\":\"_32bcd8dbe349bf0f__line-height-unset\",\"line-height-revert\":\"b4012a1a310357f4__line-height-revert\",\"line-height-revert-layer\":\"ff2ef4eddcb6e028__line-height-revert-layer\",\"letter-spacing-inherit\":\"_235241409a6f8103__letter-spacing-inherit\",\"letter-spacing-initial\":\"d860cf0adfc31190__letter-spacing-initial\",\"letter-spacing-unset\":\"abadaec0a0ceadbf__letter-spacing-unset\",\"letter-spacing-revert\":\"d6fb6f3766caddb2__letter-spacing-revert\",\"letter-spacing-revert-layer\":\"_00768243984a3b13__letter-spacing-revert-layer\",\"text-align-inherit\":\"_82d28f4984b6a9f7__text-align-inherit\",\"text-align-initial\":\"_799255031fe610e4__text-align-initial\",\"text-align-unset\":\"b1ee967d38e16fec__text-align-unset\",\"text-align-revert\":\"_6fc3935d62ac2f4e__text-align-revert\",\"text-align-revert-layer\":\"_523bd3263fe71193__text-align-revert-layer\",\"readability-dark\":\"_7c2beb4bab7d50b1__readability-dark\",\"readability-light\":\"_69065619bb900bef__readability-light\",\"destructive\":\"_72e2728c12780836__destructive\",\"highlighter-text\":\"_5319770adc3fb346__highlighter-text\",\"block\":\"_739dffda40610a31__block\",\"muted\":\"dcc48a33948e2e77__muted\",\"upper-case\":\"_813d9e8ef49f4085__upper-case\"};\n","import clsx from 'clsx';\nimport type React from 'react';\nimport { useMemo, Children, cloneElement } from '@wordpress/element';\nimport type { WordPressComponentProps } from '../context';\nimport { hasConnectNamespace, useContextSystem } from '../context';\nimport { useTruncate } from '../truncate';\nimport { getOptimalTextShade } from '../utils/colors';\nimport styles from './style.module.scss';\nimport { createHighlighterText } from './utils';\nimport { getFontSize } from '../utils/font-size';\nimport type { Props } from './types';\n\nconst CSS_WIDE_KEYWORDS = new Set( [\n\t'inherit',\n\t'initial',\n\t'unset',\n\t'revert',\n\t'revert-layer',\n] );\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').Props, 'span'>} props\n */\nexport default function useText(\n\tprops: WordPressComponentProps< Props, 'span' >\n) {\n\tconst {\n\t\tadjustLineHeightForInnerControls,\n\t\talign,\n\t\tchildren,\n\t\tclassName,\n\t\tcolor,\n\t\tellipsizeMode,\n\t\tisDestructive = false,\n\t\tdisplay,\n\t\thighlightEscape = false,\n\t\thighlightCaseSensitive = false,\n\t\thighlightWords,\n\t\thighlightSanitize,\n\t\tisBlock = false,\n\t\tletterSpacing,\n\t\tlineHeight: lineHeightProp,\n\t\toptimizeReadabilityFor,\n\t\tsize,\n\t\tstyle,\n\t\ttruncate = false,\n\t\tupperCase = false,\n\t\tvariant,\n\t\tweight = 'var(--wpds-typography-font-weight-default)',\n\t\t...otherProps\n\t} = useContextSystem( props, 'Text' );\n\n\tlet content: React.ReactNode = children;\n\tconst isHighlighter = Array.isArray( highlightWords );\n\tconst isCaption = size === 'caption';\n\n\tif ( isHighlighter ) {\n\t\tif ( typeof children !== 'string' ) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'`children` of `Text` must only be `string` types when `highlightWords` is defined'\n\t\t\t);\n\t\t}\n\n\t\tcontent = createHighlighterText( {\n\t\t\tautoEscape: highlightEscape,\n\t\t\tchildren,\n\t\t\tcaseSensitive: highlightCaseSensitive,\n\t\t\tsearchWords: highlightWords,\n\t\t\tsanitize: highlightSanitize,\n\t\t} );\n\t}\n\n\tconst optimalTextShade = useMemo(\n\t\t() =>\n\t\t\toptimizeReadabilityFor &&\n\t\t\tgetOptimalTextShade( optimizeReadabilityFor ),\n\t\t[ optimizeReadabilityFor ]\n\t);\n\tconst typography = {\n\t\tcolor,\n\t\tdisplay,\n\t\t'font-size': getFontSize( size ),\n\t\t'font-weight': weight,\n\t\t'line-height': lineHeightProp || undefined,\n\t\t'letter-spacing':\n\t\t\ttypeof letterSpacing === 'number'\n\t\t\t\t? `${ letterSpacing }px`\n\t\t\t\t: letterSpacing,\n\t\t'text-align': align,\n\t};\n\tconst textStyle: React.CSSProperties & {\n\t\t[ key: `--wp-components-text-${ string }` ]:\n\t\t\tstring | number | undefined;\n\t} = {};\n\tconst keywordClasses: string[] = [];\n\n\tfor ( const [ property, value ] of Object.entries( typography ) ) {\n\t\tconst keyword =\n\t\t\ttypeof value === 'string' ? value.trim().toLowerCase() : undefined;\n\t\tif ( keyword && CSS_WIDE_KEYWORDS.has( keyword ) ) {\n\t\t\t// CSS-wide keywords must apply to the declaration, not its custom property.\n\t\t\tkeywordClasses.push( styles[ `${ property }-${ keyword }` ] );\n\t\t} else {\n\t\t\ttextStyle[ `--wp-components-text-${ property }` ] =\n\t\t\t\tvalue === '' ? undefined : value;\n\t\t}\n\t}\n\n\tconst classes = clsx(\n\t\tstyles.text,\n\t\t! lineHeightProp &&\n\t\t\tadjustLineHeightForInnerControls && [\n\t\t\t\tstyles[ 'control-line-height' ],\n\t\t\t\tstyles[\n\t\t\t\t\t`control-line-height-${ adjustLineHeightForInnerControls }`\n\t\t\t\t],\n\t\t\t],\n\t\t{\n\t\t\t[ styles[ 'has-display' ] ]: !! display,\n\t\t\t[ styles[ 'has-letter-spacing' ] ]:\n\t\t\t\tletterSpacing !== undefined && letterSpacing !== '',\n\t\t\t[ styles[ 'has-text-align' ] ]: !! align,\n\t\t},\n\t\tkeywordClasses,\n\t\t{\n\t\t\t[ styles[ 'readability-dark' ] ]: optimalTextShade === 'dark',\n\t\t\t[ styles[ 'readability-light' ] ]:\n\t\t\t\t!! optimalTextShade && optimalTextShade !== 'dark',\n\t\t\t[ styles.destructive ]: isDestructive,\n\t\t\t[ styles[ 'highlighter-text' ] ]: isHighlighter,\n\t\t\t[ styles.block ]: isBlock,\n\t\t\t[ styles.muted ]: isCaption || variant === 'muted',\n\t\t\t[ styles[ 'upper-case' ] ]: upperCase,\n\t\t},\n\t\tclassName\n\t);\n\n\tlet finalEllipsizeMode: undefined | 'auto' | 'none';\n\tif ( truncate === true ) {\n\t\tfinalEllipsizeMode = 'auto';\n\t}\n\tif ( truncate === false ) {\n\t\tfinalEllipsizeMode = 'none';\n\t}\n\n\tconst finalComponentProps = {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tstyle: { ...textStyle, ...style },\n\t\tchildren,\n\t\tellipsizeMode: ellipsizeMode || finalEllipsizeMode,\n\t};\n\n\tconst truncateProps = useTruncate( finalComponentProps );\n\n\t/**\n\t * Enhance child `<Link />` components to inherit font size.\n\t */\n\tif ( ! truncate && Array.isArray( children ) ) {\n\t\tcontent = Children.map( children, ( child ) => {\n\t\t\tif (\n\t\t\t\ttypeof child !== 'object' ||\n\t\t\t\tchild === null ||\n\t\t\t\t! ( 'props' in child )\n\t\t\t) {\n\t\t\t\treturn child;\n\t\t\t}\n\n\t\t\tconst isLink = hasConnectNamespace( child, [ 'Link' ] );\n\t\t\tif ( isLink ) {\n\t\t\t\treturn cloneElement( child, {\n\t\t\t\t\tsize: child.props.size || 'inherit',\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn child;\n\t\t} );\n\t}\n\n\treturn {\n\t\t...truncateProps,\n\t\tchildren: truncate ? truncateProps.children : content,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC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