UNPKG

@wordpress/interactivity

Version:

Package that provides a standard and simple way to handle the frontend interactivity of Gutenberg blocks.

8 lines (7 loc) 48.1 kB
{ "version": 3, "sources": ["../src/directives.tsx"], "sourcesContent": ["// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport {\n\th as createElement,\n\tcloneElement,\n\ttype VNode,\n\ttype RefObject,\n} from 'preact';\nimport { useContext, useLayoutEffect, useMemo, useRef } from 'preact/hooks';\nimport { signal, type Signal } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseWatch,\n\tuseInit,\n\tkebabToCamelCase,\n\twarn,\n\tsplitTask,\n\tisPlainObject,\n\tdeepClone,\n} from './utils';\nimport {\n\tdirective,\n\tgetEvaluate,\n\tisDefaultDirectiveSuffix,\n\tisNonDefaultDirectiveSuffix,\n\ttype DirectiveCallback,\n\ttype DirectiveEntry,\n} from './hooks';\nimport { getScope, navigationContextSignal } from './scopes';\nimport { proxifyState, proxifyContext, deepMerge } from './proxies';\nimport { PENDING_GETTER } from './proxies/state';\n\nconst warnUniqueIdWithTwoHyphens = (\n\tprefix: string,\n\tsuffix: string,\n\tuniqueId?: string\n) => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\twarn(\n\t\t\t`The usage of data-wp-${ prefix }--${ suffix }${\n\t\t\t\tuniqueId ? `--${ uniqueId }` : ''\n\t\t\t} (two hyphens for unique ID) is deprecated and will stop working in WordPress 7.1. Please use data-wp-${ prefix }${\n\t\t\t\tuniqueId ? `--${ suffix }---${ uniqueId }` : `---${ suffix }`\n\t\t\t} (three hyphens for unique ID) from now on.`\n\t\t);\n\t}\n};\n\nconst warnUniqueIdNotSupported = ( prefix: string, uniqueId: string ) => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\twarn(\n\t\t\t`Unique IDs are not supported for the data-wp-${ prefix } directive. Ignoring the directive with unique ID \"${ uniqueId }\".`\n\t\t);\n\t}\n};\n\nconst warnWithSyncEvent = ( wrongPrefix: string, rightPrefix: string ) => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\twarn(\n\t\t\t`The usage of data-wp-${ wrongPrefix } is deprecated and will stop working in WordPress 7.0. Please, use data-wp-${ rightPrefix } with the withSyncEvent() helper from now on.`\n\t\t);\n\t}\n};\n\n/**\n * Wraps event object to warn about access of synchronous properties and methods.\n *\n * For all store actions attached to an event listener the event object is proxied via this function, unless the action\n * uses the `withSyncEvent()` utility to indicate that it requires synchronous access to the event object.\n *\n * At the moment, the proxied event only emits warnings when synchronous properties or methods are being accessed. In\n * the future this will be changed and result in an error. The current temporary behavior allows implementers to update\n * their relevant actions to use `withSyncEvent()`.\n *\n * For additional context, see https://github.com/WordPress/gutenberg/issues/64944.\n *\n * @param event Event object.\n * @return Proxied event object.\n */\nfunction wrapEventAsync( event: Event ) {\n\tconst handler = {\n\t\tget( target: Event, prop: string | symbol, receiver: any ) {\n\t\t\tconst value = target[ prop ];\n\t\t\tswitch ( prop ) {\n\t\t\t\tcase 'currentTarget':\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`Accessing the synchronous event.${ prop } property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'preventDefault':\n\t\t\t\tcase 'stopImmediatePropagation':\n\t\t\t\tcase 'stopPropagation':\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`Using the synchronous event.${ prop }() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( value instanceof Function ) {\n\t\t\t\treturn function ( this: any, ...args: any[] ) {\n\t\t\t\t\treturn value.apply(\n\t\t\t\t\t\tthis === receiver ? target : this,\n\t\t\t\t\t\targs\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t};\n\n\treturn new Proxy( event, handler );\n}\n\nconst newRule =\n\t/(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nconst ruleClean = /\\/\\*[^]*?\\*\\/| +/g;\nconst ruleNewline = /\\n+/g;\nconst empty = ' ';\n\n/**\n * Converts a css style string into a object.\n *\n * Made by Cristian Bote (@cristianbote) for Goober.\n * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js\n *\n * @param val CSS string.\n * @return CSS object.\n */\nconst cssStringToObject = (\n\tval: string\n): Record< string, string | number > => {\n\tconst tree = [ {} ];\n\tlet block, left;\n\n\twhile ( ( block = newRule.exec( val.replace( ruleClean, '' ) ) ) ) {\n\t\tif ( block[ 4 ] ) {\n\t\t\ttree.shift();\n\t\t} else if ( block[ 3 ] ) {\n\t\t\tleft = block[ 3 ].replace( ruleNewline, empty ).trim();\n\t\t\ttree.unshift( ( tree[ 0 ][ left ] = tree[ 0 ][ left ] || {} ) );\n\t\t} else {\n\t\t\ttree[ 0 ][ block[ 1 ] ] = block[ 2 ]\n\t\t\t\t.replace( ruleNewline, empty )\n\t\t\t\t.trim();\n\t\t}\n\t}\n\n\treturn tree[ 0 ];\n};\n\n/**\n * Creates a directive that adds an event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalEventDirective = (\n\ttype: 'window' | 'document'\n): DirectiveCallback => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-${ type }` ]\n\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tconst suffixParts = entry.suffix.split( '--', 2 );\n\t\t\t\tconst eventName = suffixParts[ 0 ];\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\tif ( suffixParts[ 1 ] ) {\n\t\t\t\t\t\twarnUniqueIdWithTwoHyphens(\n\t\t\t\t\t\t\t`on-${ type }`,\n\t\t\t\t\t\t\tsuffixParts[ 0 ],\n\t\t\t\t\t\t\tsuffixParts[ 1 ]\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = ( event: Event ) => {\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tif ( ! result?.sync ) {\n\t\t\t\t\t\t\t\tevent = wrapEventAsync( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\n/**\n * Obtains the given item key based on the passed `eachKey` entry. Used by the\n * `wp-each` directive.\n *\n * The item key is computed using `getEvaluate` with a mocked scope simulating\n * the specific context that inner directives will inherit, i.e., including the\n * item under the corresponding item prop.\n *\n * @param inheritedValue Inherited context value.\n * @param namespace Namespace for the `wp-each` directive.\n * @param item Item from the list of items pointed by `wp-each`.\n * @param itemProp Prop in which the item is accessible from the context.\n * @param eachKey Directive entry pointing to the item's key.\n * @return The evaluated key for the passed item.\n */\nconst evaluateItemKey = (\n\tinheritedValue: any,\n\tnamespace: string,\n\titem: unknown,\n\titemProp: string,\n\teachKey?: DirectiveEntry\n) => {\n\t// Construct a client context with the item. Note that accessing the item\n\t// prop is not reactive, as this simulated context is not proxified.\n\tconst clientContextWithItem = {\n\t\t...inheritedValue.client,\n\t\t[ namespace ]: {\n\t\t\t...inheritedValue.client[ namespace ],\n\t\t\t[ itemProp ]: item,\n\t\t},\n\t};\n\n\t// Scope must contain the client and the server contexts.\n\tconst scope = {\n\t\t...getScope(),\n\t\tcontext: clientContextWithItem,\n\t\tserverContext: inheritedValue.server,\n\t};\n\n\t// If passed, evaluate `eachKey` entry with the simulated scope. Return\n\t// `item` otherwhise.\n\treturn eachKey ? getEvaluate( { scope } )( eachKey ) : item;\n};\n\n/**\n * Generates an `Iterable` from the passed items that returns, for each item, a\n * tuple with the item, its context and its evaluated key. Used by the `wp-each`\n * directive.\n *\n * @param inheritedValue Inherited context value.\n * @param namespace Namespace for the `wp-each` directive.\n * @param items List of items pointed by `wp-each`.\n * @param itemProp Prop in which items are accessible from the context.\n * @param eachKey Directive entry pointing to the item's key.\n * @return Generator that yields items along with their context and key.\n */\nconst useItemContexts = function* (\n\tinheritedValue: any,\n\tnamespace: string,\n\titems: Iterable< unknown >,\n\titemProp: string,\n\teachKey?: DirectiveEntry\n): Generator< [ item: unknown, context: any, key: any ] > {\n\tconst { current: itemContexts } = useRef< Map< any, any > >( new Map() );\n\n\tfor ( const item of items ) {\n\t\tconst key = evaluateItemKey(\n\t\t\tinheritedValue,\n\t\t\tnamespace,\n\t\t\titem,\n\t\t\titemProp,\n\t\t\teachKey\n\t\t);\n\n\t\tif ( ! itemContexts.has( key ) ) {\n\t\t\titemContexts.set(\n\t\t\t\tkey,\n\t\t\t\tproxifyContext(\n\t\t\t\t\tproxifyState( namespace, {\n\t\t\t\t\t\t// Inits the item prop in the context to shadow it in case\n\t\t\t\t\t\t// it was inherited from the parent context. The actual\n\t\t\t\t\t\t// value is set in the `wp-each` directive later on.\n\t\t\t\t\t\t[ itemProp ]: undefined,\n\t\t\t\t\t} ),\n\t\t\t\t\tinheritedValue.client[ namespace ]\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tyield [ item, itemContexts.get( key ), key ];\n\t}\n};\n\n/**\n * Creates a directive that adds an async event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalAsyncEventDirective = (\n\ttype: 'window' | 'document'\n): DirectiveCallback => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-async-${ type }` ]\n\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnWithSyncEvent( `on-async-${ type }`, `on-${ type }` );\n\t\t\t\t}\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = async ( event: Event ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb, {\n\t\t\t\t\t\tpassive: true,\n\t\t\t\t\t} );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\n/**\n * Relates each router region with its current vDOM content. Used by the\n * `router-region` directive.\n *\n * Keys are router region IDs, and values are signals with the corresponding\n * VNode rendered inside. If the value is `null`, that means the regions should\n * not be rendered. If the value is `undefined`, the region is already contained\n * inside another router region and does not need to change its children.\n */\nexport const routerRegions = new Map<\n\tstring,\n\tSignal< VNode | null | undefined >\n>();\n\nexport default () => {\n\t// data-wp-context---[unique-id]\n\tdirective(\n\t\t'context',\n\t\t( {\n\t\t\tdirectives: { context },\n\t\t\tprops: { children },\n\t\t\tcontext: inheritedContext,\n\t\t} ) => {\n\t\t\tconst entries = context\n\t\t\t\t.filter( isDefaultDirectiveSuffix )\n\t\t\t\t// Reverses entries to make the ones with unique IDs override the default one.\n\t\t\t\t.reverse();\n\n\t\t\t// Doesn't do anything if there are no default entries.\n\t\t\tif ( ! entries.length ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'The usage of data-wp-context--unique-id (two hyphens) is not supported. To add a unique ID to the directive, please use data-wp-context---unique-id (three hyphens) instead.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst { client: inheritedClient, server: inheritedServer } =\n\t\t\t\tuseContext( inheritedContext );\n\t\t\tconst client = useRef( {} );\n\t\t\tconst server = {};\n\t\t\tconst result = {\n\t\t\t\tclient: { ...inheritedClient },\n\t\t\t\tserver: { ...inheritedServer },\n\t\t\t};\n\t\t\tconst namespaces = new Set< string >();\n\n\t\t\tentries.forEach( ( { value, namespace, uniqueId } ) => {\n\t\t\t\t// Checks that the value is a JSON object. Sends a console warning if not.\n\t\t\t\tif ( ! isPlainObject( value ) ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`The value of data-wp-context${\n\t\t\t\t\t\t\t\tuniqueId ? `---${ uniqueId }` : ''\n\t\t\t\t\t\t\t} on the ${ namespace } namespace must be a valid stringified JSON object.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If the namespace doesn't exist yet, initalizes an empty\n\t\t\t\t// proxified state for that namespace's client context.\n\t\t\t\tif ( ! client.current[ namespace ] ) {\n\t\t\t\t\tclient.current[ namespace ] = proxifyState( namespace, {} );\n\t\t\t\t}\n\n\t\t\t\t// Merges the new client value with whatever was there before.\n\t\t\t\tdeepMerge(\n\t\t\t\t\tclient.current[ namespace ],\n\t\t\t\t\tdeepClone( value ),\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\t// Replaces the server context for that namespace with the\n\t\t\t\t// current value.\n\t\t\t\tserver[ namespace ] = value;\n\n\t\t\t\t// Registers the namespace.\n\t\t\t\tnamespaces.add( namespace );\n\t\t\t} );\n\n\t\t\tnamespaces.forEach( ( namespace ) => {\n\t\t\t\tresult.client[ namespace ] = proxifyContext(\n\t\t\t\t\tclient.current[ namespace ],\n\t\t\t\t\tinheritedClient[ namespace ]\n\t\t\t\t);\n\t\t\t\tresult.server[ namespace ] = proxifyContext(\n\t\t\t\t\tserver[ namespace ],\n\t\t\t\t\tinheritedServer[ namespace ]\n\t\t\t\t);\n\t\t\t} );\n\n\t\t\treturn createElement( Provider, { value: result }, children );\n\t\t},\n\t\t{ priority: 5 }\n\t);\n\n\t// data-wp-watch---[unique-id]\n\tdirective( 'watch', ( { directives: { watch }, evaluate } ) => {\n\t\twatch.forEach( ( entry ) => {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\tif ( entry.suffix ) {\n\t\t\t\t\twarnUniqueIdWithTwoHyphens( 'watch', entry.suffix );\n\t\t\t\t}\n\t\t\t}\n\t\t\tuseWatch( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet result = evaluate( entry );\n\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\tresult = result();\n\t\t\t\t}\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-init---[unique-id]\n\tdirective( 'init', ( { directives: { init }, evaluate } ) => {\n\t\tinit.forEach( ( entry ) => {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\tif ( entry.suffix ) {\n\t\t\t\t\twarnUniqueIdWithTwoHyphens( 'init', entry.suffix );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: Replace with useEffect to prevent unneeded scopes.\n\t\t\tuseInit( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet result = evaluate( entry );\n\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\tresult = result();\n\t\t\t\t}\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api init ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: init ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-on--[event]---[unique-id]\n\tdirective( 'on', ( { directives: { on }, element, evaluate } ) => {\n\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\ton.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tconst suffixParts = entry.suffix.split( '--', 2 );\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\tif ( suffixParts[ 1 ] ) {\n\t\t\t\t\twarnUniqueIdWithTwoHyphens(\n\t\t\t\t\t\t'on',\n\t\t\t\t\t\tsuffixParts[ 0 ],\n\t\t\t\t\t\tsuffixParts[ 1 ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! events.has( suffixParts[ 0 ] ) ) {\n\t\t\t\tevents.set( suffixParts[ 0 ], new Set< DirectiveEntry >() );\n\t\t\t}\n\t\t\tevents.get( suffixParts[ 0 ] )!.add( entry );\n\t\t} );\n\n\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\texistingHandler( event );\n\t\t\t\t}\n\t\t\t\tentries.forEach( ( entry ) => {\n\t\t\t\t\tlet start;\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\tif ( ! result?.sync ) {\n\t\t\t\t\t\t\tevent = wrapEventAsync( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult( event );\n\t\t\t\t\t}\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t\t`interactivity api on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\t\ttrack: `IA: on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t} );\n\t} );\n\n\t// data-wp-on-async--[event] (deprecated)\n\tdirective(\n\t\t'on-async',\n\t\t( { directives: { 'on-async': onAsync }, element, evaluate } ) => {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\twarnWithSyncEvent( 'on-async', 'on' );\n\t\t\t}\n\t\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\t\tonAsync\n\t\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst event = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t\t}\n\t\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t\t} );\n\n\t\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tentries.forEach( async ( entry ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-on-window--[event]---[unique-id]\n\tdirective( 'on-window', getGlobalEventDirective( 'window' ) );\n\t// data-wp-on-document--[event]---[unique-id]\n\tdirective( 'on-document', getGlobalEventDirective( 'document' ) );\n\n\t// data-wp-on-async-window--[event] (deprecated)\n\tdirective( 'on-async-window', getGlobalAsyncEventDirective( 'window' ) );\n\t// data-wp-on-async-document--[event] (deprecated)\n\tdirective(\n\t\t'on-async-document',\n\t\tgetGlobalAsyncEventDirective( 'document' )\n\t);\n\n\t// data-wp-class--[classname]\n\tdirective(\n\t\t'class',\n\t\t( { directives: { class: classNames }, element, evaluate } ) => {\n\t\t\tclassNames\n\t\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst className = entry.uniqueId\n\t\t\t\t\t\t? `${ entry.suffix }---${ entry.uniqueId }`\n\t\t\t\t\t\t: entry.suffix;\n\t\t\t\t\tlet result = evaluate( entry );\n\t\t\t\t\tif ( result === PENDING_GETTER ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\tresult = result();\n\t\t\t\t\t}\n\t\t\t\t\tconst currentClass = element.props.class || '';\n\t\t\t\t\tconst classFinder = new RegExp(\n\t\t\t\t\t\t`(^|\\\\s)${ className }(\\\\s|$)`,\n\t\t\t\t\t\t'g'\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t.replace( classFinder, ' ' )\n\t\t\t\t\t\t\t.trim();\n\t\t\t\t\t} else if ( ! classFinder.test( currentClass ) ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t? `${ currentClass } ${ className }`\n\t\t\t\t\t\t\t: className;\n\t\t\t\t\t}\n\n\t\t\t\t\tuseInit( () => {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * This seems necessary because Preact doesn't change the class\n\t\t\t\t\t\t * names on the hydration, so we have to do it manually. It doesn't\n\t\t\t\t\t\t * need deps because it only needs to do it the first time.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.remove( className );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.add( className );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-style--[style-prop]\n\tdirective( 'style', ( { directives: { style }, element, evaluate } ) => {\n\t\tstyle.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tif ( entry.uniqueId ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnUniqueIdNotSupported( 'style', entry.uniqueId );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst styleProp = entry.suffix;\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( result === PENDING_GETTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\telement.props.style = element.props.style || {};\n\t\t\tif ( typeof element.props.style === 'string' ) {\n\t\t\t\telement.props.style = cssStringToObject( element.props.style );\n\t\t\t}\n\t\t\tif ( ! result ) {\n\t\t\t\tdelete element.props.style[ styleProp ];\n\t\t\t} else {\n\t\t\t\telement.props.style[ styleProp ] = result;\n\t\t\t}\n\n\t\t\tuseInit( () => {\n\t\t\t\t/*\n\t\t\t\t * This seems necessary because Preact doesn't change the styles on\n\t\t\t\t * the hydration, so we have to do it manually. It doesn't need deps\n\t\t\t\t * because it only needs to do it the first time.\n\t\t\t\t */\n\t\t\t\tif ( ! result ) {\n\t\t\t\t\t(\n\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t ).current!.style.removeProperty( styleProp );\n\t\t\t\t} else {\n\t\t\t\t\t(\n\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t ).current!.style.setProperty( styleProp, result );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-bind--[attribute]\n\tdirective( 'bind', ( { directives: { bind }, element, evaluate } ) => {\n\t\tbind.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tif ( entry.uniqueId ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnUniqueIdNotSupported( 'bind', entry.uniqueId );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst attribute = entry.suffix;\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( result === PENDING_GETTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\telement.props[ attribute ] = result;\n\n\t\t\t/*\n\t\t\t * This is necessary because Preact doesn't change the attributes on the\n\t\t\t * hydration, so we have to do it manually. It only needs to do it the\n\t\t\t * first time. After that, Preact will handle the changes.\n\t\t\t */\n\t\t\tuseInit( () => {\n\t\t\t\tconst el = ( element.ref as RefObject< HTMLElement > ).current!;\n\n\t\t\t\t/*\n\t\t\t\t * We set the value directly to the corresponding HTMLElement instance\n\t\t\t\t * property excluding the following special cases. We follow Preact's\n\t\t\t\t * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129\n\t\t\t\t */\n\t\t\t\tif ( attribute === 'style' ) {\n\t\t\t\t\tif ( typeof result === 'string' ) {\n\t\t\t\t\t\tel.style.cssText = result;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} else if (\n\t\t\t\t\tattribute !== 'width' &&\n\t\t\t\t\tattribute !== 'height' &&\n\t\t\t\t\tattribute !== 'href' &&\n\t\t\t\t\tattribute !== 'list' &&\n\t\t\t\t\tattribute !== 'form' &&\n\t\t\t\t\t/*\n\t\t\t\t\t * The value for `tabindex` follows the parsing rules for an\n\t\t\t\t\t * integer. If that fails, or if the attribute isn't present, then\n\t\t\t\t\t * the browsers should \"follow platform conventions to determine if\n\t\t\t\t\t * the element should be considered as a focusable area\",\n\t\t\t\t\t * practically meaning that most elements get a default of `-1` (not\n\t\t\t\t\t * focusable), but several also get a default of `0` (focusable in\n\t\t\t\t\t * order after all elements with a positive `tabindex` value).\n\t\t\t\t\t *\n\t\t\t\t\t * @see https://html.spec.whatwg.org/#tabindex-value\n\t\t\t\t\t */\n\t\t\t\t\tattribute !== 'tabIndex' &&\n\t\t\t\t\tattribute !== 'download' &&\n\t\t\t\t\tattribute !== 'rowSpan' &&\n\t\t\t\t\tattribute !== 'colSpan' &&\n\t\t\t\t\tattribute !== 'role' &&\n\t\t\t\t\tattribute in el\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tel[ attribute ] =\n\t\t\t\t\t\t\tresult === null || result === undefined\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: result;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} catch ( err ) {}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * aria- and data- attributes have no boolean representation.\n\t\t\t\t * A `false` value is different from the attribute not being\n\t\t\t\t * present, so we can't remove it.\n\t\t\t\t * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\tresult !== null &&\n\t\t\t\t\tresult !== undefined &&\n\t\t\t\t\t( result !== false || attribute[ 4 ] === '-' )\n\t\t\t\t) {\n\t\t\t\t\tel.setAttribute( attribute, result );\n\t\t\t\t} else {\n\t\t\t\t\tel.removeAttribute( attribute );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-ignore (deprecated)\n\tdirective(\n\t\t'ignore',\n\t\t( {\n\t\t\telement: {\n\t\t\t\ttype: Type,\n\t\t\t\tprops: { innerHTML, ...rest },\n\t\t\t},\n\t\t}: {\n\t\t\telement: any;\n\t\t} ) => {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\twarn(\n\t\t\t\t\t'The data-wp-ignore directive is deprecated and will be removed in version 7.0.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Preserve the initial inner HTML\n\t\t\tconst cached = useMemo( () => innerHTML, [] );\n\t\t\treturn createElement( Type, {\n\t\t\t\tdangerouslySetInnerHTML: { __html: cached },\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-text\n\tdirective( 'text', ( { directives: { text }, element, evaluate } ) => {\n\t\tconst entries = text.filter( isDefaultDirectiveSuffix );\n\t\t// Doesn't do anything if there are no default entries.\n\t\tif ( ! entries.length ) {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\twarn(\n\t\t\t\t\t'The usage of data-wp-text--suffix is not supported. Please use data-wp-text instead.'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tentries.forEach( ( entry ) => {\n\t\t\tif ( entry.uniqueId ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnUniqueIdNotSupported( 'text', entry.uniqueId );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tlet result = evaluate( entry );\n\t\t\t\tif ( result === PENDING_GETTER ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\tresult = result();\n\t\t\t\t}\n\t\t\t\telement.props.children =\n\t\t\t\t\ttypeof result === 'object' ? null : result.toString();\n\t\t\t} catch ( e ) {\n\t\t\t\telement.props.children = null;\n\t\t\t}\n\t\t} );\n\t} );\n\n\t// data-wp-run---[unique-id]\n\tdirective( 'run', ( { directives: { run }, evaluate } ) => {\n\t\trun.forEach( ( entry ) => {\n\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\tif ( entry.suffix ) {\n\t\t\t\t\twarnUniqueIdWithTwoHyphens( 'run', entry.suffix );\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\t} );\n\n\t// data-wp-each--[item]\n\tdirective(\n\t\t'each',\n\t\t( {\n\t\t\tdirectives: { each, 'each-key': eachKey },\n\t\t\tcontext: inheritedContext,\n\t\t\telement,\n\t\t\tevaluate,\n\t\t} ) => {\n\t\t\tif ( element.type !== 'template' ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'The data-wp-each directive can only be used on <template> elements.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst inheritedValue = useContext( inheritedContext );\n\n\t\t\tconst [ entry ] = each;\n\t\t\tconst { namespace, suffix, uniqueId } = entry;\n\n\t\t\tif ( each.length > 1 ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarn(\n\t\t\t\t\t\t'The usage of multiple data-wp-each directives on the same element is not supported. Please pick only one.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( uniqueId ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnUniqueIdNotSupported( 'each', uniqueId );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet iterable = evaluate( entry );\n\t\t\tif ( iterable === PENDING_GETTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( typeof iterable === 'function' ) {\n\t\t\t\titerable = iterable();\n\t\t\t}\n\n\t\t\tif ( typeof iterable?.[ Symbol.iterator ] !== 'function' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst itemProp = suffix ? kebabToCamelCase( suffix ) : 'item';\n\n\t\t\tconst result: VNode< any >[] = [];\n\n\t\t\tconst itemContexts = useItemContexts(\n\t\t\t\tinheritedValue,\n\t\t\t\tnamespace,\n\t\t\t\titerable,\n\t\t\t\titemProp,\n\t\t\t\teachKey?.[ 0 ]\n\t\t\t);\n\n\t\t\tfor ( const [ item, itemContext, key ] of itemContexts ) {\n\t\t\t\tconst mergedContext = {\n\t\t\t\t\tclient: {\n\t\t\t\t\t\t...inheritedValue.client,\n\t\t\t\t\t\t[ namespace ]: itemContext,\n\t\t\t\t\t},\n\t\t\t\t\tserver: { ...inheritedValue.server },\n\t\t\t\t};\n\n\t\t\t\t// Sets the item after proxifying the context.\n\t\t\t\tmergedContext.client[ namespace ][ itemProp ] = item;\n\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateElement(\n\t\t\t\t\t\tProvider,\n\t\t\t\t\t\t{ value: mergedContext, key },\n\t\t\t\t\t\telement.props.content\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t{ priority: 20 }\n\t);\n\n\t// data-wp-each-child (internal use only)\n\tdirective(\n\t\t'each-child',\n\t\t( { directives: { 'each-child': eachChild }, element, evaluate } ) => {\n\t\t\tconst entry = eachChild.find( isDefaultDirectiveSuffix );\n\n\t\t\tif ( ! entry ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst iterable = evaluate( entry );\n\t\t\treturn iterable === PENDING_GETTER ? element : null;\n\t\t},\n\t\t{ priority: 1 }\n\t);\n\n\t// data-wp-router-region\n\tdirective(\n\t\t'router-region',\n\t\t( { directives: { 'router-region': routerRegion } } ) => {\n\t\t\tconst entry = routerRegion.find( isDefaultDirectiveSuffix );\n\t\t\tif ( ! entry ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( entry.suffix ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarn(\n\t\t\t\t\t\t`Suffixes for the data-wp-router-region directive are not supported. Ignoring the directive with suffix \"${ entry.suffix }\".`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( entry.uniqueId ) {\n\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\twarnUniqueIdNotSupported( 'router-region', entry.uniqueId );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst regionId =\n\t\t\t\ttypeof entry.value === 'string'\n\t\t\t\t\t? entry.value\n\t\t\t\t\t: ( entry.value as any ).id;\n\n\t\t\tif ( ! routerRegions.has( regionId ) ) {\n\t\t\t\trouterRegions.set( regionId, signal() );\n\t\t\t}\n\n\t\t\t// Get the content of this router region.\n\t\t\tconst vdom = routerRegions.get( regionId )!.value;\n\n\t\t\t// Triggers an invalidation after the directive data-wp-context has\n\t\t\t// been evaluated and the value of the server context has changed.\n\t\t\tuseLayoutEffect( () => {\n\t\t\t\tif ( vdom && typeof vdom.type !== 'string' ) {\n\t\t\t\t\tnavigationContextSignal.value =\n\t\t\t\t\t\tnavigationContextSignal.peek() + 1;\n\t\t\t\t}\n\t\t\t}, [ vdom ] );\n\n\t\t\tif ( vdom && typeof vdom.type !== 'string' ) {\n\t\t\t\t// The scope needs to be injected.\n\t\t\t\tconst previousScope = getScope();\n\t\t\t\treturn cloneElement( vdom, { previousScope } );\n\t\t\t}\n\t\t\treturn vdom;\n\t\t},\n\t\t{ priority: 1 }\n\t);\n};\n"], "mappings": ";AAMA;AAAA,EAC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