@hyperfixi/core 2.3.1 → 2.4.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/dist/api/dom-processor.d.ts +8 -4
- package/dist/api/hyperscript-api.d.ts +5 -1
- package/dist/ast-utils/index.js +25320 -94
- package/dist/ast-utils/index.mjs +25320 -94
- package/dist/ast-utils/interchange/types.d.ts +7 -1
- package/dist/behaviors/index.js +54 -100
- package/dist/behaviors/index.mjs +54 -100
- package/dist/bundle-generator/index.js +19 -2
- package/dist/bundle-generator/index.mjs +19 -2
- package/dist/bundle-generator/parser-templates.d.ts +1 -1
- package/dist/bundle-generator/template-capabilities.d.ts +1 -1
- package/dist/chunks/bridge-C4d3blZX.js +2 -0
- package/dist/chunks/browser-modular-BwIRlrTM.js +2 -0
- package/dist/chunks/feature-eventsource-BpZvPy_K.js +2 -0
- package/dist/chunks/{feature-sockets-ClOH7vk7.js → feature-sockets-CrYvjZ4j.js} +2 -2
- package/dist/chunks/feature-webworker-BSYguEIW.js +2 -0
- package/dist/chunks/index-Beno_SBy.js +2 -0
- package/dist/commands/advanced/async.d.ts +6 -2
- package/dist/commands/advanced/js.d.ts +1 -1
- package/dist/commands/animation/start-view-transition.d.ts +24 -0
- package/dist/commands/async/fetch.d.ts +6 -1
- package/dist/commands/control-flow/repeat.d.ts +2 -0
- package/dist/commands/data/clear.d.ts +23 -0
- package/dist/commands/data/set.d.ts +6 -0
- package/dist/commands/dom/close.d.ts +19 -0
- package/dist/commands/dom/empty.d.ts +19 -0
- package/dist/commands/dom/open.d.ts +21 -0
- package/dist/commands/dom/reset.d.ts +19 -0
- package/dist/commands/dom/select.d.ts +19 -0
- package/dist/commands/dom/swap.d.ts +7 -4
- package/dist/commands/events/trigger.d.ts +1 -1
- package/dist/commands/execution/blur.d.ts +19 -0
- package/dist/commands/execution/call.d.ts +1 -2
- package/dist/commands/execution/focus.d.ts +19 -0
- package/dist/commands/helpers/element-resolution.d.ts +2 -2
- package/dist/commands/helpers/event-waiting.d.ts +1 -1
- package/dist/commands/helpers/numeric-target-parser.d.ts +7 -0
- package/dist/commands/index.d.ts +34 -2
- package/dist/commands/index.js +19352 -4845
- package/dist/commands/index.mjs +19320 -4846
- package/dist/commands/navigation/go.d.ts +3 -0
- package/dist/commands/navigation/scroll-to.d.ts +26 -0
- package/dist/commands/utility/beep.d.ts +2 -2
- package/dist/commands/utility/breakpoint.d.ts +19 -0
- package/dist/commands/utility/pick.d.ts +11 -2
- package/dist/compatibility/browser-bundle-modular.d.ts +2 -2
- package/dist/compatibility/browser-bundle-multilingual.d.ts +1 -1
- package/dist/compatibility/browser-bundle-semantic-complete.d.ts +3 -3
- package/dist/compatibility/browser-bundle.d.ts +13 -6
- package/dist/compatibility/browser-modular.d.ts +1 -3
- package/dist/core/expression-evaluator.d.ts +4 -4
- package/dist/core/expression-registry.d.ts +8 -0
- package/dist/expressions/bundles/common-expressions.d.ts +2 -2
- package/dist/expressions/bundles/core-expressions.d.ts +2 -2
- package/dist/expressions/bundles/full-expressions.d.ts +2 -2
- package/dist/expressions/bundles/index.d.ts +3 -3
- package/dist/expressions/collection/index.d.ts +35 -0
- package/dist/expressions/conversion/impl/index.d.ts +1 -1
- package/dist/expressions/index.d.ts +4 -3
- package/dist/expressions/index.js +1117 -1590
- package/dist/expressions/index.mjs +1113 -1586
- package/dist/expressions/logical/index.d.ts +2 -0
- package/dist/expressions/mathematical/index.d.ts +11 -0
- package/dist/expressions/shared/index.d.ts +1 -1
- package/dist/expressions/shared/number-utils.d.ts +1 -0
- package/dist/htmx/htmx-attribute-processor.d.ts +37 -1
- package/dist/htmx/htmx-translator.d.ts +2 -0
- package/dist/htmx/i18n-hooks.d.ts +15 -0
- package/dist/htmx/i18n-orchestrator.d.ts +15 -0
- package/dist/htmx/lang-resolver.d.ts +3 -0
- package/dist/htmx/sse.d.ts +60 -0
- package/dist/htmx/ws.d.ts +59 -0
- package/dist/hyperfixi-browser-classic-i18n.js +2 -0
- package/dist/hyperfixi-browser-minimal.js +1 -0
- package/dist/hyperfixi-browser-standard.js +2 -0
- package/dist/hyperfixi-browser.js +2 -0
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx-v4.js +1 -0
- package/dist/hyperfixi-hx.js +1 -1
- package/dist/hyperfixi-hybrid-complete.js +1 -1
- package/dist/hyperfixi-hybrid-hx.js +1 -0
- package/dist/hyperfixi-minimal.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi-standard.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +43591 -45060
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +43588 -45061
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/morph-adapter.d.ts +0 -13
- package/dist/lib/swap-executor.d.ts +0 -10
- package/dist/lib/view-transitions.d.ts +1 -30
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser-minimal.js +1 -1
- package/dist/lokascript-browser-standard.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-hybrid-complete.js +1 -1
- package/dist/lokascript-hybrid-hx.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/lsp-metadata.d.ts +9 -4
- package/dist/lsp-metadata.js +187 -3
- package/dist/lsp-metadata.mjs +185 -4
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.js +3 -3
- package/dist/metadata.mjs +3 -3
- package/dist/multilingual/bridge.d.ts +1 -1
- package/dist/multilingual/index.js +79 -22
- package/dist/multilingual/index.mjs +79 -22
- package/dist/parser/command-parsers/animation-commands.d.ts +1 -0
- package/dist/parser/command-parsers/utility-commands.d.ts +1 -0
- package/dist/parser/extensions.d.ts +51 -0
- package/dist/parser/full-parser.js +1224 -899
- package/dist/parser/full-parser.mjs +1224 -899
- package/dist/parser/helpers/ast-helpers.d.ts +1 -0
- package/dist/parser/helpers/parsing-helpers.d.ts +4 -0
- package/dist/parser/parser-types.d.ts +8 -28
- package/dist/parser/parser.d.ts +3 -7
- package/dist/parser/pratt-parser.d.ts +0 -3
- package/dist/parser/runtime.d.ts +4 -0
- package/dist/parser/semantic-integration.d.ts +17 -0
- package/dist/parser/types.d.ts +7 -1
- package/dist/reference/index.js +91 -0
- package/dist/reference/index.mjs +91 -0
- package/dist/registry/index.js +12866 -5876
- package/dist/registry/index.mjs +12866 -5876
- package/dist/registry/universal-types.d.ts +2 -1
- package/dist/runtime/command-adapter.d.ts +23 -16
- package/dist/runtime/plugin.d.ts +14 -0
- package/dist/runtime/runtime-base.d.ts +32 -7
- package/dist/runtime/runtime-factory.d.ts +3 -3
- package/dist/runtime/runtime.d.ts +2 -2
- package/dist/test-setup.d.ts +1 -0
- package/dist/types/base-types.d.ts +3 -0
- package/dist/types/feature-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +26 -20
- package/vocab/htmx/ar.js +60 -0
- package/vocab/htmx/bn.js +49 -0
- package/vocab/htmx/de.js +60 -0
- package/vocab/htmx/en.js +21 -0
- package/vocab/htmx/es.js +60 -0
- package/vocab/htmx/fr.js +59 -0
- package/vocab/htmx/he.js +40 -0
- package/vocab/htmx/hi.js +60 -0
- package/vocab/htmx/id.js +57 -0
- package/vocab/htmx/it.js +58 -0
- package/vocab/htmx/ja.js +60 -0
- package/vocab/htmx/ko.js +60 -0
- package/vocab/htmx/ms.js +35 -0
- package/vocab/htmx/pl.js +60 -0
- package/vocab/htmx/pt.js +60 -0
- package/vocab/htmx/qu.js +60 -0
- package/vocab/htmx/ru.js +60 -0
- package/vocab/htmx/sw.js +59 -0
- package/vocab/htmx/th.js +49 -0
- package/vocab/htmx/tl.js +33 -0
- package/vocab/htmx/tr.js +60 -0
- package/vocab/htmx/uk.js +60 -0
- package/vocab/htmx/vi.js +51 -0
- package/vocab/htmx/zh.js +60 -0
- package/dist/bundles/test-minimal.d.ts +0 -3
- package/dist/bundles/test-standard.d.ts +0 -3
- package/dist/chunks/bridge-Clbh_xAj.js +0 -2
- package/dist/chunks/browser-modular-DIOxQqhV.js +0 -2
- package/dist/chunks/feature-eventsource-B5F2-H1r.js +0 -2
- package/dist/chunks/feature-webworker-3bAp0ac9.js +0 -2
- package/dist/chunks/index-DcxoRUBe.js +0 -2
- package/dist/compatibility/browser-bundle-minimal.d.ts +0 -8
- package/dist/compatibility/browser-bundle-standard.d.ts +0 -8
- package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +0 -13
- package/dist/core/base-expression-evaluator.d.ts +0 -74
- package/dist/core/binary-expression-evaluator.d.ts +0 -7
- package/dist/core/call-expression-evaluator.d.ts +0 -7
- package/dist/core/configurable-expression-evaluator.d.ts +0 -5
- package/dist/core/lazy-expression-evaluator.d.ts +0 -22
- package/dist/core/parser.d.ts +0 -21
- package/dist/core/selector-evaluator.d.ts +0 -15
- package/dist/core/template-literal-evaluator.d.ts +0 -5
- package/dist/expressions/comparison/index.d.ts +0 -80
- package/dist/expressions/comparison/utils.d.ts +0 -2
- package/dist/expressions/conversion/impl/bridge.d.ts +0 -117
- package/dist/expressions/logical/impl/pattern-matching.d.ts +0 -58
- package/dist/expressions/positional/impl/bridge.d.ts +0 -95
- package/dist/expressions/property/index.d.ts +0 -55
- package/dist/expressions/references/impl/bridge.d.ts +0 -54
- package/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/tailwind.d.ts +0 -22
- package/dist/mod.d.ts +0 -63
- package/dist/parser/expression-parser.d.ts +0 -6
- package/dist/runtime/runtime-experimental.d.ts +0 -18
- package/dist/scripts/code-generator.d.ts +0 -64
- package/dist/scripts/generate-missing-commands.d.ts +0 -4
|
@@ -19,5 +19,6 @@ export declare function createPropertyOfExpression(property: ASTNode, target: AS
|
|
|
19
19
|
export declare function createCommandSequence(commands: ASTNode[]): CommandSequenceNode;
|
|
20
20
|
export declare function createErrorNode(pos: Position): IdentifierNode;
|
|
21
21
|
export declare function createErrorCommandNode(pos: Position, message: string, source?: string): ASTNode;
|
|
22
|
+
export declare function createPartialCommandNode(name: string, pos: Position): ASTNode;
|
|
22
23
|
export declare function createProgramNode(statements: ASTNode[]): ASTNode;
|
|
23
24
|
//# sourceMappingURL=ast-helpers.d.ts.map
|
|
@@ -16,4 +16,8 @@ export declare function consumeKeywordToArgs(ctx: ParserContext, keyword: string
|
|
|
16
16
|
export declare function consumeOneOfKeywordsToArgs(ctx: ParserContext, keywords: string[], args: ASTNode[]): string | null;
|
|
17
17
|
export declare function parseHyphenatedName(ctx: ParserContext): string;
|
|
18
18
|
export declare function consumeOptionalKeyword(ctx: ParserContext, keyword: string): boolean;
|
|
19
|
+
export declare function parseMaybeNamedArgument(ctx: ParserContext): {
|
|
20
|
+
name?: string;
|
|
21
|
+
value: ASTNode;
|
|
22
|
+
};
|
|
19
23
|
//# sourceMappingURL=parsing-helpers.d.ts.map
|
|
@@ -111,45 +111,25 @@ export interface TokenPredicates {
|
|
|
111
111
|
}
|
|
112
112
|
export interface ASTFactory {
|
|
113
113
|
createIdentifier(name: string): IdentifierNode;
|
|
114
|
-
createLiteral(value: unknown, raw: string): ASTNode;
|
|
115
|
-
createSelector(value: string): ASTNode;
|
|
116
|
-
createBinaryExpression(operator: string, left: ASTNode, right: ASTNode): ASTNode;
|
|
117
|
-
createUnaryExpression(operator: string, operand: ASTNode, prefix?: boolean): ASTNode;
|
|
118
|
-
createMemberExpression(object: ASTNode, property: ASTNode, computed: boolean): ASTNode;
|
|
119
|
-
createPossessiveExpression(object: ASTNode, property: ASTNode): ASTNode;
|
|
120
|
-
createCallExpression(callee: ASTNode, args: ASTNode[]): ASTNode;
|
|
121
|
-
createErrorNode(): ASTNode;
|
|
122
|
-
createProgramNode(statements: ASTNode[]): ASTNode;
|
|
123
|
-
createCommandFromIdentifier(identifierNode: IdentifierNode): CommandNode;
|
|
124
114
|
}
|
|
125
115
|
export interface ExpressionParser {
|
|
126
116
|
parseExpression(): ASTNode;
|
|
127
117
|
parsePrimary(): ASTNode;
|
|
128
|
-
parseCall(): ASTNode;
|
|
129
|
-
parseAssignment(): ASTNode;
|
|
130
|
-
parseLogicalOr(): ASTNode;
|
|
131
118
|
parseLogicalAnd(): ASTNode;
|
|
132
|
-
parseEquality(): ASTNode;
|
|
133
|
-
parseComparison(): ASTNode;
|
|
134
|
-
parseAddition(): ASTNode;
|
|
135
|
-
parseMultiplication(): ASTNode;
|
|
136
|
-
parseImplicitBinary(): ASTNode;
|
|
137
|
-
parseConditional(): ASTNode;
|
|
138
|
-
parseConditionalBranch(): ASTNode;
|
|
139
|
-
parseEventHandler(): ASTNode;
|
|
140
|
-
parseBehaviorDefinition(): ASTNode;
|
|
141
|
-
parseNavigationFunction(): ASTNode;
|
|
142
|
-
parseMyPropertyAccess(): ASTNode;
|
|
143
|
-
parseDollarExpression(): ASTNode;
|
|
144
|
-
parseHyperscriptSelector(): ASTNode;
|
|
145
|
-
parseAttributeOrArrayLiteral(): ASTNode;
|
|
146
|
-
parseObjectLiteral(): ASTNode;
|
|
147
119
|
parseCSSObjectLiteral(): ASTNode;
|
|
148
120
|
}
|
|
149
121
|
export interface CommandParser {
|
|
150
122
|
parseCommand(): CommandNode;
|
|
151
123
|
parseCommandSequence(): ASTNode;
|
|
152
124
|
parseCommandListUntilEnd(): ASTNode[];
|
|
125
|
+
parseCommandListUntilEndOrElse(): {
|
|
126
|
+
commands: ASTNode[];
|
|
127
|
+
hasElse: boolean;
|
|
128
|
+
};
|
|
129
|
+
parseRepeatBody(): {
|
|
130
|
+
commands: ASTNode[];
|
|
131
|
+
terminator: string;
|
|
132
|
+
};
|
|
153
133
|
}
|
|
154
134
|
export interface PositionCheckpoint {
|
|
155
135
|
savePosition(): number;
|
package/dist/parser/parser.d.ts
CHANGED
|
@@ -23,14 +23,7 @@ export declare class Parser {
|
|
|
23
23
|
private static readonly PRATT_TABLE;
|
|
24
24
|
private parseExpressionPratt;
|
|
25
25
|
private makePrattContext;
|
|
26
|
-
private parseAssignment;
|
|
27
|
-
private parseLogicalOr;
|
|
28
26
|
private parseLogicalAnd;
|
|
29
|
-
private parseEquality;
|
|
30
|
-
private parseComparison;
|
|
31
|
-
private parseAddition;
|
|
32
|
-
private parseMultiplication;
|
|
33
|
-
private parseUnary;
|
|
34
27
|
private parseImplicitBinary;
|
|
35
28
|
private isCommand;
|
|
36
29
|
private isKeyword;
|
|
@@ -42,7 +35,10 @@ export declare class Parser {
|
|
|
42
35
|
private parseHaltCommand;
|
|
43
36
|
private parseMeasureCommand;
|
|
44
37
|
private parseTriggerCommand;
|
|
38
|
+
private parseCommandListUntilTerminator;
|
|
45
39
|
private parseCommandListUntilEnd;
|
|
40
|
+
private parseCommandListUntilEndOrElse;
|
|
41
|
+
private parseRepeatBody;
|
|
46
42
|
private parseRepeatCommand;
|
|
47
43
|
private parseForCommand;
|
|
48
44
|
private parseWaitCommand;
|
|
@@ -33,10 +33,7 @@ export declare function leftAssoc(bp: number, handler?: InfixHandler): Pick<Bind
|
|
|
33
33
|
export declare function rightAssoc(bp: number, handler?: InfixHandler): Pick<BindingPowerEntry, 'infix'>;
|
|
34
34
|
export declare function prefix(bp: number, handler?: PrefixHandler): Pick<BindingPowerEntry, 'prefix'>;
|
|
35
35
|
export declare const CORE_FRAGMENT: BindingPowerFragment;
|
|
36
|
-
export declare const POSITIONAL_FRAGMENT: BindingPowerFragment;
|
|
37
|
-
export declare const PROPERTY_FRAGMENT: BindingPowerFragment;
|
|
38
36
|
export declare const PARSER_COMPARISON_FRAGMENT: BindingPowerFragment;
|
|
39
37
|
export declare const ASSIGNMENT_FRAGMENT: BindingPowerFragment;
|
|
40
|
-
export declare const FULL_TABLE: BindingPowerFragment;
|
|
41
38
|
export declare const PARSER_TABLE: BindingPowerFragment;
|
|
42
39
|
//# sourceMappingURL=pratt-parser.d.ts.map
|
package/dist/parser/runtime.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { ASTNode, ExecutionContext } from '../types/core';
|
|
2
|
+
import type { ExecutionResult } from '../types/result';
|
|
3
|
+
export { setGlobal } from './extensions';
|
|
2
4
|
export declare function evaluateAST(node: ASTNode, context: ExecutionContext): Promise<any>;
|
|
5
|
+
export declare function evaluateASTWithResult(node: ASTNode, context: ExecutionContext): Promise<ExecutionResult<unknown>>;
|
|
6
|
+
export declare function evaluateExpressionFromSource(source: string, context: ExecutionContext): Promise<any>;
|
|
3
7
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -56,6 +56,23 @@ export declare class SemanticIntegrationAdapter {
|
|
|
56
56
|
getConfidenceThreshold(): number;
|
|
57
57
|
}
|
|
58
58
|
export declare function createSemanticIntegration(options: SemanticIntegrationOptions): SemanticIntegrationAdapter;
|
|
59
|
+
interface SemanticParseFn {
|
|
60
|
+
(input: string, language: string): {
|
|
61
|
+
node: {
|
|
62
|
+
action: string;
|
|
63
|
+
roles: ReadonlyMap<string, unknown>;
|
|
64
|
+
} | null;
|
|
65
|
+
confidence: number;
|
|
66
|
+
error?: string;
|
|
67
|
+
tokensConsumed?: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export declare function createSemanticAdapter(deps: {
|
|
71
|
+
parse: SemanticParseFn;
|
|
72
|
+
isRegistered: (language: string) => boolean;
|
|
73
|
+
registered: () => string[];
|
|
74
|
+
}): SemanticAnalyzer;
|
|
59
75
|
export declare function shouldUseSemanticResult(result: SemanticAnalysisResult, threshold?: number): boolean;
|
|
60
76
|
export declare function languageBenefitsFromSemantic(language: string): boolean;
|
|
77
|
+
export {};
|
|
61
78
|
//# sourceMappingURL=semantic-integration.d.ts.map
|
package/dist/parser/types.d.ts
CHANGED
|
@@ -112,7 +112,13 @@ export interface ParserOptions {
|
|
|
112
112
|
semanticAnalyzer?: SemanticAnalyzerInterface;
|
|
113
113
|
language?: string;
|
|
114
114
|
semanticConfidenceThreshold?: number;
|
|
115
|
-
registryIntegration?:
|
|
115
|
+
registryIntegration?: ParserRegistryIntegration;
|
|
116
|
+
}
|
|
117
|
+
export interface ParserRegistryIntegration {
|
|
118
|
+
hasEventSource(eventName: string): boolean;
|
|
119
|
+
getEventSource(eventName: string): {
|
|
120
|
+
name: string;
|
|
121
|
+
} | undefined;
|
|
116
122
|
}
|
|
117
123
|
export declare const HYPERSCRIPT_KEYWORDS: Set<string>;
|
|
118
124
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/reference/index.js
CHANGED
|
@@ -57,6 +57,78 @@ const commands = {
|
|
|
57
57
|
availability: 'hybrid',
|
|
58
58
|
examples: ['make <div.card/>', 'make <button/> put into #toolbar'],
|
|
59
59
|
},
|
|
60
|
+
empty: {
|
|
61
|
+
name: 'empty',
|
|
62
|
+
description: 'Remove all children from an element (sets innerHTML to empty)',
|
|
63
|
+
syntax: 'empty [target]',
|
|
64
|
+
category: 'dom',
|
|
65
|
+
availability: 'lite-plus',
|
|
66
|
+
examples: ['empty me', 'empty #list', 'empty .results'],
|
|
67
|
+
},
|
|
68
|
+
open: {
|
|
69
|
+
name: 'open',
|
|
70
|
+
description: 'Open a dialog (showModal/show), details element, or popover',
|
|
71
|
+
syntax: 'open [target] [as modal|non-modal]',
|
|
72
|
+
category: 'dom',
|
|
73
|
+
availability: 'full',
|
|
74
|
+
examples: ['open #myDialog', 'open #myDialog as non-modal', 'open #details', 'open #popup'],
|
|
75
|
+
},
|
|
76
|
+
close: {
|
|
77
|
+
name: 'close',
|
|
78
|
+
description: 'Close a dialog, details element, or popover',
|
|
79
|
+
syntax: 'close [target]',
|
|
80
|
+
category: 'dom',
|
|
81
|
+
availability: 'full',
|
|
82
|
+
examples: ['close', 'close #myDialog', 'close #details'],
|
|
83
|
+
},
|
|
84
|
+
select: {
|
|
85
|
+
name: 'select',
|
|
86
|
+
description: 'Select the text in an <input>/<textarea>, or select the contents of a DOM element',
|
|
87
|
+
syntax: 'select [target]',
|
|
88
|
+
category: 'dom',
|
|
89
|
+
availability: 'full',
|
|
90
|
+
examples: ['select #search', 'select <textarea/>', 'select me'],
|
|
91
|
+
},
|
|
92
|
+
reset: {
|
|
93
|
+
name: 'reset',
|
|
94
|
+
description: 'Reset a <form> to its default values (HTMLFormElement.reset())',
|
|
95
|
+
syntax: 'reset [target]',
|
|
96
|
+
category: 'dom',
|
|
97
|
+
availability: 'full',
|
|
98
|
+
examples: ['reset', 'reset #myForm', 'reset <form/>'],
|
|
99
|
+
},
|
|
100
|
+
clear: {
|
|
101
|
+
name: 'clear',
|
|
102
|
+
description: 'Reset a variable to null, or clear the value of a form field (<input>, <textarea>, <select>)',
|
|
103
|
+
syntax: 'clear <var|target>',
|
|
104
|
+
category: 'data',
|
|
105
|
+
availability: 'full',
|
|
106
|
+
examples: ['clear :count', 'clear myVar', 'clear #search', 'clear <textarea/>'],
|
|
107
|
+
},
|
|
108
|
+
breakpoint: {
|
|
109
|
+
name: 'breakpoint',
|
|
110
|
+
description: 'Drop into the debugger (emits a debugger; statement)',
|
|
111
|
+
syntax: 'breakpoint',
|
|
112
|
+
category: 'utility',
|
|
113
|
+
availability: 'full',
|
|
114
|
+
examples: ['breakpoint', 'on click breakpoint'],
|
|
115
|
+
},
|
|
116
|
+
focus: {
|
|
117
|
+
name: 'focus',
|
|
118
|
+
description: 'Focus an element (calls HTMLElement.focus())',
|
|
119
|
+
syntax: 'focus [target]',
|
|
120
|
+
category: 'execution',
|
|
121
|
+
availability: 'lite-plus',
|
|
122
|
+
examples: ['focus #search', 'focus on <input/>', 'focus me'],
|
|
123
|
+
},
|
|
124
|
+
blur: {
|
|
125
|
+
name: 'blur',
|
|
126
|
+
description: 'Remove focus from an element (calls HTMLElement.blur())',
|
|
127
|
+
syntax: 'blur [target]',
|
|
128
|
+
category: 'execution',
|
|
129
|
+
availability: 'lite-plus',
|
|
130
|
+
examples: ['blur #search', 'blur on <input/>', 'blur me'],
|
|
131
|
+
},
|
|
60
132
|
swap: {
|
|
61
133
|
name: 'swap',
|
|
62
134
|
description: 'Replace element content using various strategies',
|
|
@@ -228,6 +300,14 @@ const commands = {
|
|
|
228
300
|
availability: 'hybrid',
|
|
229
301
|
examples: ['replace url /new-path'],
|
|
230
302
|
},
|
|
303
|
+
scroll: {
|
|
304
|
+
name: 'scroll',
|
|
305
|
+
description: 'Scroll an element into view (upstream _hyperscript 0.9.90 replacement for `go to top of`)',
|
|
306
|
+
syntax: 'scroll to [top|bottom|middle|center|nearest] [of] target [smoothly|instantly]',
|
|
307
|
+
category: 'navigation',
|
|
308
|
+
availability: 'full',
|
|
309
|
+
examples: ['scroll to #top', 'scroll to bottom of #chat', 'scroll to me smoothly'],
|
|
310
|
+
},
|
|
231
311
|
if: {
|
|
232
312
|
name: 'if',
|
|
233
313
|
description: 'Conditional execution',
|
|
@@ -324,6 +404,17 @@ const commands = {
|
|
|
324
404
|
availability: 'hybrid',
|
|
325
405
|
examples: ['append "<li>New</li>" to #list', 'append result to #container'],
|
|
326
406
|
},
|
|
407
|
+
start: {
|
|
408
|
+
name: 'start',
|
|
409
|
+
description: 'Animate DOM mutations via document.startViewTransition (View Transitions API)',
|
|
410
|
+
syntax: 'start view transition [using type] <body> end',
|
|
411
|
+
category: 'animation',
|
|
412
|
+
availability: 'full',
|
|
413
|
+
examples: [
|
|
414
|
+
'start view transition put result into #out end',
|
|
415
|
+
'start view transition using slide remove .open from #panel end',
|
|
416
|
+
],
|
|
417
|
+
},
|
|
327
418
|
transition: {
|
|
328
419
|
name: 'transition',
|
|
329
420
|
description: 'Apply CSS transitions',
|
package/dist/reference/index.mjs
CHANGED
|
@@ -55,6 +55,78 @@ const commands = {
|
|
|
55
55
|
availability: 'hybrid',
|
|
56
56
|
examples: ['make <div.card/>', 'make <button/> put into #toolbar'],
|
|
57
57
|
},
|
|
58
|
+
empty: {
|
|
59
|
+
name: 'empty',
|
|
60
|
+
description: 'Remove all children from an element (sets innerHTML to empty)',
|
|
61
|
+
syntax: 'empty [target]',
|
|
62
|
+
category: 'dom',
|
|
63
|
+
availability: 'lite-plus',
|
|
64
|
+
examples: ['empty me', 'empty #list', 'empty .results'],
|
|
65
|
+
},
|
|
66
|
+
open: {
|
|
67
|
+
name: 'open',
|
|
68
|
+
description: 'Open a dialog (showModal/show), details element, or popover',
|
|
69
|
+
syntax: 'open [target] [as modal|non-modal]',
|
|
70
|
+
category: 'dom',
|
|
71
|
+
availability: 'full',
|
|
72
|
+
examples: ['open #myDialog', 'open #myDialog as non-modal', 'open #details', 'open #popup'],
|
|
73
|
+
},
|
|
74
|
+
close: {
|
|
75
|
+
name: 'close',
|
|
76
|
+
description: 'Close a dialog, details element, or popover',
|
|
77
|
+
syntax: 'close [target]',
|
|
78
|
+
category: 'dom',
|
|
79
|
+
availability: 'full',
|
|
80
|
+
examples: ['close', 'close #myDialog', 'close #details'],
|
|
81
|
+
},
|
|
82
|
+
select: {
|
|
83
|
+
name: 'select',
|
|
84
|
+
description: 'Select the text in an <input>/<textarea>, or select the contents of a DOM element',
|
|
85
|
+
syntax: 'select [target]',
|
|
86
|
+
category: 'dom',
|
|
87
|
+
availability: 'full',
|
|
88
|
+
examples: ['select #search', 'select <textarea/>', 'select me'],
|
|
89
|
+
},
|
|
90
|
+
reset: {
|
|
91
|
+
name: 'reset',
|
|
92
|
+
description: 'Reset a <form> to its default values (HTMLFormElement.reset())',
|
|
93
|
+
syntax: 'reset [target]',
|
|
94
|
+
category: 'dom',
|
|
95
|
+
availability: 'full',
|
|
96
|
+
examples: ['reset', 'reset #myForm', 'reset <form/>'],
|
|
97
|
+
},
|
|
98
|
+
clear: {
|
|
99
|
+
name: 'clear',
|
|
100
|
+
description: 'Reset a variable to null, or clear the value of a form field (<input>, <textarea>, <select>)',
|
|
101
|
+
syntax: 'clear <var|target>',
|
|
102
|
+
category: 'data',
|
|
103
|
+
availability: 'full',
|
|
104
|
+
examples: ['clear :count', 'clear myVar', 'clear #search', 'clear <textarea/>'],
|
|
105
|
+
},
|
|
106
|
+
breakpoint: {
|
|
107
|
+
name: 'breakpoint',
|
|
108
|
+
description: 'Drop into the debugger (emits a debugger; statement)',
|
|
109
|
+
syntax: 'breakpoint',
|
|
110
|
+
category: 'utility',
|
|
111
|
+
availability: 'full',
|
|
112
|
+
examples: ['breakpoint', 'on click breakpoint'],
|
|
113
|
+
},
|
|
114
|
+
focus: {
|
|
115
|
+
name: 'focus',
|
|
116
|
+
description: 'Focus an element (calls HTMLElement.focus())',
|
|
117
|
+
syntax: 'focus [target]',
|
|
118
|
+
category: 'execution',
|
|
119
|
+
availability: 'lite-plus',
|
|
120
|
+
examples: ['focus #search', 'focus on <input/>', 'focus me'],
|
|
121
|
+
},
|
|
122
|
+
blur: {
|
|
123
|
+
name: 'blur',
|
|
124
|
+
description: 'Remove focus from an element (calls HTMLElement.blur())',
|
|
125
|
+
syntax: 'blur [target]',
|
|
126
|
+
category: 'execution',
|
|
127
|
+
availability: 'lite-plus',
|
|
128
|
+
examples: ['blur #search', 'blur on <input/>', 'blur me'],
|
|
129
|
+
},
|
|
58
130
|
swap: {
|
|
59
131
|
name: 'swap',
|
|
60
132
|
description: 'Replace element content using various strategies',
|
|
@@ -226,6 +298,14 @@ const commands = {
|
|
|
226
298
|
availability: 'hybrid',
|
|
227
299
|
examples: ['replace url /new-path'],
|
|
228
300
|
},
|
|
301
|
+
scroll: {
|
|
302
|
+
name: 'scroll',
|
|
303
|
+
description: 'Scroll an element into view (upstream _hyperscript 0.9.90 replacement for `go to top of`)',
|
|
304
|
+
syntax: 'scroll to [top|bottom|middle|center|nearest] [of] target [smoothly|instantly]',
|
|
305
|
+
category: 'navigation',
|
|
306
|
+
availability: 'full',
|
|
307
|
+
examples: ['scroll to #top', 'scroll to bottom of #chat', 'scroll to me smoothly'],
|
|
308
|
+
},
|
|
229
309
|
if: {
|
|
230
310
|
name: 'if',
|
|
231
311
|
description: 'Conditional execution',
|
|
@@ -322,6 +402,17 @@ const commands = {
|
|
|
322
402
|
availability: 'hybrid',
|
|
323
403
|
examples: ['append "<li>New</li>" to #list', 'append result to #container'],
|
|
324
404
|
},
|
|
405
|
+
start: {
|
|
406
|
+
name: 'start',
|
|
407
|
+
description: 'Animate DOM mutations via document.startViewTransition (View Transitions API)',
|
|
408
|
+
syntax: 'start view transition [using type] <body> end',
|
|
409
|
+
category: 'animation',
|
|
410
|
+
availability: 'full',
|
|
411
|
+
examples: [
|
|
412
|
+
'start view transition put result into #out end',
|
|
413
|
+
'start view transition using slide remove .open from #panel end',
|
|
414
|
+
],
|
|
415
|
+
},
|
|
325
416
|
transition: {
|
|
326
417
|
name: 'transition',
|
|
327
418
|
description: 'Apply CSS transitions',
|