@hyperfixi/core 3.3.0 → 4.0.1
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/README.md +57 -179
- package/dist/ast-utils/index.cjs +74 -806
- package/dist/ast-utils/index.d.ts +1 -1
- package/dist/ast-utils/index.mjs +74 -805
- package/dist/ast-utils/interchange/engine-positions.d.ts +3 -0
- package/dist/ast-utils/interchange/index.d.ts +1 -2
- package/dist/hyperfixi.js +19 -2
- package/dist/index.d.ts +2 -22
- package/dist/index.mjs +3 -29128
- package/dist/lsp-metadata.cjs +77 -73
- package/dist/lsp-metadata.d.ts +4 -4
- package/dist/lsp-metadata.mjs +77 -73
- package/dist/metadata.cjs +34 -266
- package/dist/metadata.d.ts +31 -26
- package/dist/metadata.mjs +34 -266
- package/dist/multilingual/index.cjs +16 -382
- package/dist/multilingual/index.d.ts +4 -32
- package/dist/multilingual/index.mjs +15 -377
- package/dist/reference/index.cjs +67 -216
- package/dist/reference/index.d.ts +0 -3
- package/dist/reference/index.mjs +68 -216
- package/dist/version.d.ts +1 -1
- package/package.json +13 -179
- package/dist/__test-utils__/context-builders.d.ts +0 -42
- package/dist/__test-utils__/error-testing.d.ts +0 -18
- package/dist/__test-utils__/index.d.ts +0 -6
- package/dist/__test-utils__/mock-types.d.ts +0 -57
- package/dist/__test-utils__/parser-context-mock.d.ts +0 -7
- package/dist/__test-utils__/parser-helpers.d.ts +0 -38
- package/dist/api/hyperscript-api.d.ts +0 -90
- package/dist/api/lokascript-api.d.ts +0 -9
- package/dist/ast/command-slots.d.ts +0 -140
- package/dist/ast/guards.d.ts +0 -15
- package/dist/ast/legacy.d.ts +0 -15
- package/dist/ast/nodes.d.ts +0 -243
- package/dist/ast-utils/interchange/from-core.d.ts +0 -12
- package/dist/ast-utils/interchange/to-core.d.ts +0 -8
- package/dist/behaviors/boosted.d.ts +0 -29
- package/dist/behaviors/history-swap.d.ts +0 -24
- package/dist/behaviors/index.cjs +0 -1155
- package/dist/behaviors/index.d.ts +0 -4
- package/dist/behaviors/index.mjs +0 -1145
- package/dist/bundle-generator/executor-core.d.ts +0 -4
- package/dist/bundle-generator/generator.d.ts +0 -4
- package/dist/bundle-generator/index.cjs +0 -2804
- package/dist/bundle-generator/index.d.ts +0 -6
- package/dist/bundle-generator/index.mjs +0 -2779
- package/dist/bundle-generator/parser-templates.d.ts +0 -6
- package/dist/bundle-generator/template-capabilities.d.ts +0 -12
- package/dist/bundle-generator/templates.d.ts +0 -12
- package/dist/bundle-generator/types.d.ts +0 -34
- package/dist/chunks/bridge-CI9SOl8u.js +0 -2
- package/dist/chunks/browser-modular-7CpI5VF2.js +0 -2
- package/dist/chunks/index-BwXDEK0m.js +0 -2
- package/dist/chunks/index-DQi2o8Lk.js +0 -2
- package/dist/chunks/index-uCOQ8Qn0.js +0 -2
- package/dist/commands/advanced/js.d.ts +0 -40
- package/dist/commands/animation/measure.d.ts +0 -43
- package/dist/commands/animation/settle.d.ts +0 -38
- package/dist/commands/animation/start-view-transition.d.ts +0 -38
- package/dist/commands/animation/take.d.ts +0 -41
- package/dist/commands/animation/transition.d.ts +0 -49
- package/dist/commands/async/fetch.d.ts +0 -61
- package/dist/commands/async/wait.d.ts +0 -51
- package/dist/commands/behaviors/install.d.ts +0 -40
- package/dist/commands/content/append.d.ts +0 -26
- package/dist/commands/content/insertion-base.d.ts +0 -60
- package/dist/commands/content/prepend.d.ts +0 -26
- package/dist/commands/control-flow/break.d.ts +0 -29
- package/dist/commands/control-flow/continue.d.ts +0 -29
- package/dist/commands/control-flow/exit.d.ts +0 -29
- package/dist/commands/control-flow/halt.d.ts +0 -39
- package/dist/commands/control-flow/if.d.ts +0 -58
- package/dist/commands/control-flow/repeat.d.ts +0 -50
- package/dist/commands/control-flow/return.d.ts +0 -33
- package/dist/commands/control-flow/signal-base.d.ts +0 -18
- package/dist/commands/control-flow/throw.d.ts +0 -34
- package/dist/commands/control-flow/unless.d.ts +0 -3
- package/dist/commands/data/clear.d.ts +0 -37
- package/dist/commands/data/decrement.d.ts +0 -3
- package/dist/commands/data/default.d.ts +0 -60
- package/dist/commands/data/get.d.ts +0 -35
- package/dist/commands/data/increment.d.ts +0 -42
- package/dist/commands/data/set.d.ts +0 -76
- package/dist/commands/decorators/index.d.ts +0 -14
- package/dist/commands/dom/add.d.ts +0 -44
- package/dist/commands/dom/close.d.ts +0 -32
- package/dist/commands/dom/dom-modification-base.d.ts +0 -48
- package/dist/commands/dom/empty.d.ts +0 -32
- package/dist/commands/dom/hide.d.ts +0 -28
- package/dist/commands/dom/make.d.ts +0 -34
- package/dist/commands/dom/open.d.ts +0 -34
- package/dist/commands/dom/process-partials.d.ts +0 -51
- package/dist/commands/dom/put.d.ts +0 -42
- package/dist/commands/dom/remove.d.ts +0 -46
- package/dist/commands/dom/reset.d.ts +0 -32
- package/dist/commands/dom/select.d.ts +0 -32
- package/dist/commands/dom/show.d.ts +0 -29
- package/dist/commands/dom/swap.d.ts +0 -65
- package/dist/commands/dom/toggle.d.ts +0 -69
- package/dist/commands/dom/visibility-base.d.ts +0 -22
- package/dist/commands/events/send.d.ts +0 -3
- package/dist/commands/events/trigger.d.ts +0 -49
- package/dist/commands/execution/blur.d.ts +0 -32
- package/dist/commands/execution/call.d.ts +0 -35
- package/dist/commands/execution/focus.d.ts +0 -32
- package/dist/commands/execution/pseudo-command.d.ts +0 -41
- package/dist/commands/helpers/attribute-manipulation.d.ts +0 -11
- package/dist/commands/helpers/attribute-target.d.ts +0 -9
- package/dist/commands/helpers/batch-dom-operations.d.ts +0 -12
- package/dist/commands/helpers/body-ops.d.ts +0 -10
- package/dist/commands/helpers/class-manipulation.d.ts +0 -11
- package/dist/commands/helpers/condition-helpers.d.ts +0 -4
- package/dist/commands/helpers/dom-mutation.d.ts +0 -16
- package/dist/commands/helpers/duration-parsing.d.ts +0 -8
- package/dist/commands/helpers/element-property-access.d.ts +0 -7
- package/dist/commands/helpers/element-resolution.d.ts +0 -16
- package/dist/commands/helpers/error-helpers.d.ts +0 -17
- package/dist/commands/helpers/event-helpers.d.ts +0 -13
- package/dist/commands/helpers/event-waiting.d.ts +0 -37
- package/dist/commands/helpers/index.d.ts +0 -32
- package/dist/commands/helpers/input-validator.d.ts +0 -23
- package/dist/commands/helpers/loop-executor.d.ts +0 -56
- package/dist/commands/helpers/numeric-target-parser.d.ts +0 -21
- package/dist/commands/helpers/property-target.d.ts +0 -20
- package/dist/commands/helpers/selector-type-detection.d.ts +0 -24
- package/dist/commands/helpers/slots.d.ts +0 -5
- package/dist/commands/helpers/smart-element.d.ts +0 -16
- package/dist/commands/helpers/style-manipulation.d.ts +0 -16
- package/dist/commands/helpers/target-elements.d.ts +0 -5
- package/dist/commands/helpers/temporal-modifiers.d.ts +0 -15
- package/dist/commands/helpers/url-argument-parser.d.ts +0 -13
- package/dist/commands/helpers/url-validation.d.ts +0 -7
- package/dist/commands/helpers/variable-access.d.ts +0 -13
- package/dist/commands/helpers/visibility-target-parser.d.ts +0 -15
- package/dist/commands/helpers/write-target.d.ts +0 -42
- package/dist/commands/index.cjs +0 -24168
- package/dist/commands/index.d.ts +0 -171
- package/dist/commands/index.mjs +0 -23981
- package/dist/commands/manifest.d.ts +0 -17
- package/dist/commands/navigation/go.d.ts +0 -58
- package/dist/commands/navigation/push-url.d.ts +0 -48
- package/dist/commands/navigation/replace-url.d.ts +0 -3
- package/dist/commands/navigation/scroll-to.d.ts +0 -43
- package/dist/commands/templates/render.d.ts +0 -47
- package/dist/commands/utility/beep.d.ts +0 -41
- package/dist/commands/utility/breakpoint.d.ts +0 -32
- package/dist/commands/utility/copy.d.ts +0 -41
- package/dist/commands/utility/log.d.ts +0 -36
- package/dist/commands/utility/pick.d.ts +0 -47
- package/dist/commands/utility/tell.d.ts +0 -39
- package/dist/compatibility/browser-bundle-classic.d.ts +0 -17
- package/dist/compatibility/browser-bundle-hybrid-complete.d.ts +0 -22
- package/dist/compatibility/browser-bundle-hybrid-hx.d.ts +0 -43
- package/dist/compatibility/browser-bundle-lite.d.ts +0 -15
- package/dist/compatibility/browser-bundle-modular.d.ts +0 -18
- package/dist/compatibility/browser-bundle-multilingual.d.ts +0 -19
- package/dist/compatibility/browser-bundle-semantic-complete.d.ts +0 -24
- package/dist/compatibility/browser-bundle-textshelf-minimal.d.ts +0 -16
- package/dist/compatibility/browser-bundle-textshelf-profile.d.ts +0 -18
- package/dist/compatibility/browser-modular.d.ts +0 -42
- package/dist/compatibility/browser-tests/helpers/semantic-page.d.ts +0 -3
- package/dist/compatibility/browser-tests/test-utils.d.ts +0 -21
- package/dist/compatibility/bundle-shell.d.ts +0 -13
- package/dist/compatibility/bundle-sources.d.ts +0 -4
- package/dist/compatibility/eval-hyperscript.d.ts +0 -16
- package/dist/compatibility/hyperscript-adapter.d.ts +0 -38
- package/dist/core/ast-property-utils.d.ts +0 -2
- package/dist/core/context.d.ts +0 -19
- package/dist/core/dom.d.ts +0 -15
- package/dist/core/evaluator-types.d.ts +0 -5
- package/dist/core/events.d.ts +0 -48
- package/dist/core/executor.d.ts +0 -34
- package/dist/core/expression-evaluator.d.ts +0 -6
- package/dist/core/expression-registry.d.ts +0 -8
- package/dist/core/scope-hooks.d.ts +0 -24
- package/dist/debug/debug-controller.d.ts +0 -62
- package/dist/debug/index.d.ts +0 -5
- package/dist/dom/attribute-processor.d.ts +0 -75
- package/dist/dom/detect-language.d.ts +0 -3
- package/dist/dom/minimal-attribute-processor.d.ts +0 -20
- package/dist/expressions/base-expression.d.ts +0 -27
- package/dist/expressions/bundles/common-expressions.d.ts +0 -10
- package/dist/expressions/bundles/core-expressions.d.ts +0 -8
- package/dist/expressions/bundles/full-expressions.d.ts +0 -11
- package/dist/expressions/bundles/index.d.ts +0 -7
- package/dist/expressions/collection/index.d.ts +0 -10
- package/dist/expressions/conversion/index.d.ts +0 -31
- package/dist/expressions/expression-tiers.d.ts +0 -13
- package/dist/expressions/index.cjs +0 -4331
- package/dist/expressions/index.d.ts +0 -13
- package/dist/expressions/index.mjs +0 -4312
- package/dist/expressions/logical/index.d.ts +0 -61
- package/dist/expressions/mathematical/index.d.ts +0 -80
- package/dist/expressions/positional/index.d.ts +0 -31
- package/dist/expressions/properties/index.d.ts +0 -27
- package/dist/expressions/property-access-utils.d.ts +0 -23
- package/dist/expressions/references/index.d.ts +0 -39
- package/dist/expressions/shared/comparison-utils.d.ts +0 -10
- package/dist/expressions/shared/index.d.ts +0 -10
- package/dist/expressions/shared/number-utils.d.ts +0 -8
- package/dist/expressions/shared/tracking.d.ts +0 -20
- package/dist/expressions/shared/validation-utils.d.ts +0 -13
- package/dist/expressions/special/index.d.ts +0 -78
- package/dist/expressions/type-helpers.d.ts +0 -11
- package/dist/expressions/type-registry.d.ts +0 -57
- package/dist/expressions/validation-helpers.d.ts +0 -15
- package/dist/htmx/hcon.d.ts +0 -9
- package/dist/htmx/htmx-attribute-processor.d.ts +0 -120
- package/dist/htmx/htmx-translator.d.ts +0 -22
- package/dist/htmx/i18n-hooks.d.ts +0 -18
- package/dist/htmx/i18n-orchestrator.d.ts +0 -16
- package/dist/htmx/index.d.ts +0 -3
- package/dist/htmx/lang-resolver.d.ts +0 -3
- package/dist/htmx/sse.d.ts +0 -60
- package/dist/htmx/ws.d.ts +0 -59
- package/dist/hyperfixi-browser-classic-i18n.js +0 -2
- package/dist/hyperfixi-browser.js +0 -2
- package/dist/hyperfixi-classic-i18n.js +0 -2
- package/dist/hyperfixi-hx-v4.js +0 -1
- package/dist/hyperfixi-hx.js +0 -1
- package/dist/hyperfixi-hybrid-complete.js +0 -1
- package/dist/hyperfixi-hybrid-hx.js +0 -1
- package/dist/hyperfixi-multilingual.js +0 -2
- package/dist/hyperfixi.mjs +0 -2
- package/dist/i18n/error-catalog.d.ts +0 -12
- package/dist/index.cjs +0 -29159
- package/dist/index.min.js +0 -2
- package/dist/lib/dom-globals-shim.d.ts +0 -2
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/morph-adapter.d.ts +0 -9
- package/dist/lib/swap-executor.d.ts +0 -12
- package/dist/lib/view-transitions.d.ts +0 -7
- package/dist/lokascript-browser-classic-i18n.js +0 -2
- package/dist/lokascript-browser.js +0 -2
- package/dist/lokascript-hybrid-complete.js +0 -1
- package/dist/lokascript-hybrid-hx.js +0 -1
- package/dist/lokascript-multilingual.js +0 -2
- package/dist/lse/index.cjs +0 -84
- package/dist/lse/index.d.ts +0 -15
- package/dist/lse/index.mjs +0 -71
- package/dist/multilingual/bridge.d.ts +0 -38
- package/dist/multilingual/schema-roles.d.ts +0 -3
- package/dist/parser/__types__/test-helpers.d.ts +0 -25
- package/dist/parser/command-grammar.d.ts +0 -14
- package/dist/parser/command-node-builder.d.ts +0 -46
- package/dist/parser/command-parsers/animation-commands.d.ts +0 -6
- package/dist/parser/command-parsers/async-commands.d.ts +0 -5
- package/dist/parser/command-parsers/control-flow-commands.d.ts +0 -7
- package/dist/parser/command-parsers/declared-commands.d.ts +0 -6
- package/dist/parser/command-parsers/dom-commands.d.ts +0 -11
- package/dist/parser/command-parsers/event-commands.d.ts +0 -4
- package/dist/parser/command-parsers/navigation-commands.d.ts +0 -6
- package/dist/parser/command-parsers/utility-commands.d.ts +0 -14
- package/dist/parser/command-parsers/variable-commands.d.ts +0 -12
- package/dist/parser/error-handler.d.ts +0 -34
- package/dist/parser/extensions.d.ts +0 -43
- package/dist/parser/full-parser.cjs +0 -7943
- package/dist/parser/full-parser.d.ts +0 -4
- package/dist/parser/full-parser.mjs +0 -7940
- package/dist/parser/helpers/ast-helpers.d.ts +0 -24
- package/dist/parser/helpers/parsing-helpers.d.ts +0 -19
- package/dist/parser/helpers/token-helpers.d.ts +0 -28
- package/dist/parser/hybrid/aliases.cjs +0 -44
- package/dist/parser/hybrid/aliases.d.ts +0 -7
- package/dist/parser/hybrid/aliases.mjs +0 -37
- package/dist/parser/hybrid/ast-types.cjs +0 -3
- package/dist/parser/hybrid/ast-types.d.ts +0 -97
- package/dist/parser/hybrid/ast-types.mjs +0 -2
- package/dist/parser/hybrid/index.cjs +0 -1185
- package/dist/parser/hybrid/index.d.ts +0 -6
- package/dist/parser/hybrid/index.mjs +0 -1175
- package/dist/parser/hybrid/parser-core.cjs +0 -1171
- package/dist/parser/hybrid/parser-core.d.ts +0 -69
- package/dist/parser/hybrid/parser-core.mjs +0 -1169
- package/dist/parser/hybrid/tokenizer.cjs +0 -255
- package/dist/parser/hybrid/tokenizer.d.ts +0 -9
- package/dist/parser/hybrid/tokenizer.mjs +0 -252
- package/dist/parser/hybrid-parser.cjs +0 -1249
- package/dist/parser/hybrid-parser.d.ts +0 -10
- package/dist/parser/hybrid-parser.mjs +0 -1242
- package/dist/parser/parser-constants.d.ts +0 -100
- package/dist/parser/parser-interface.d.ts +0 -12
- package/dist/parser/parser-types.d.ts +0 -164
- package/dist/parser/parser.d.ts +0 -165
- package/dist/parser/pratt-parser.d.ts +0 -41
- package/dist/parser/regex-parser.cjs +0 -422
- package/dist/parser/regex-parser.d.ts +0 -4
- package/dist/parser/regex-parser.mjs +0 -419
- package/dist/parser/runtime.d.ts +0 -14
- package/dist/parser/semantic-integration.d.ts +0 -17
- package/dist/parser/token-consumer.d.ts +0 -34
- package/dist/parser/token-predicates.d.ts +0 -77
- package/dist/parser/tokenizer.d.ts +0 -28
- package/dist/parser/types.d.ts +0 -105
- package/dist/performance/expression-cache.d.ts +0 -78
- package/dist/performance/integration.d.ts +0 -40
- package/dist/performance/production-monitor.d.ts +0 -67
- package/dist/registry/browser-types.cjs +0 -81
- package/dist/registry/browser-types.d.ts +0 -20
- package/dist/registry/browser-types.mjs +0 -76
- package/dist/registry/environment.cjs +0 -36
- package/dist/registry/environment.d.ts +0 -19
- package/dist/registry/environment.mjs +0 -30
- package/dist/registry/event-source-registry.d.ts +0 -54
- package/dist/registry/examples/server-commands.d.ts +0 -6
- package/dist/registry/examples/server-event-source.d.ts +0 -32
- package/dist/registry/index.cjs +0 -14055
- package/dist/registry/index.d.ts +0 -39
- package/dist/registry/index.mjs +0 -14039
- package/dist/registry/runtime-integration.d.ts +0 -23
- package/dist/registry/universal-types.cjs +0 -91
- package/dist/registry/universal-types.d.ts +0 -35
- package/dist/registry/universal-types.mjs +0 -86
- package/dist/runtime/cleanup-registry.d.ts +0 -47
- package/dist/runtime/command-adapter.d.ts +0 -69
- package/dist/runtime/environment.d.ts +0 -75
- package/dist/runtime/plugin.d.ts +0 -14
- package/dist/runtime/runtime-base.d.ts +0 -100
- package/dist/runtime/runtime-factory.d.ts +0 -29
- package/dist/runtime/runtime.d.ts +0 -20
- package/dist/runtime/temporal-modifiers.d.ts +0 -37
- package/dist/test-setup.d.ts +0 -28
- package/dist/test-utilities.d.ts +0 -39
- package/dist/types/base-types.d.ts +0 -231
- package/dist/types/code-fix.d.ts +0 -39
- package/dist/types/command-metadata.d.ts +0 -57
- package/dist/types/command-types.d.ts +0 -262
- package/dist/types/context-types.d.ts +0 -106
- package/dist/types/core-context.d.ts +0 -22
- package/dist/types/core.d.ts +0 -143
- package/dist/types/error-codes.d.ts +0 -207
- package/dist/types/expression-types.d.ts +0 -155
- package/dist/types/hooks.d.ts +0 -45
- package/dist/types/index.d.ts +0 -32
- package/dist/types/program.d.ts +0 -8
- package/dist/types/result.d.ts +0 -73
- package/dist/types/template-types.d.ts +0 -162
- package/dist/types/type-guards.d.ts +0 -24
- package/dist/types/unified-types.d.ts +0 -91
- package/dist/utils/beep.d.ts +0 -8
- package/dist/utils/debug-events.d.ts +0 -41
- package/dist/utils/debug.d.ts +0 -35
- package/dist/utils/dom-utils.d.ts +0 -16
- package/dist/utils/element-check.d.ts +0 -8
- package/dist/utils/keyboard-shortcuts.d.ts +0 -18
- package/dist/utils/performance.d.ts +0 -40
- package/dist/validation/command-pattern-validator.d.ts +0 -53
- package/dist/validation/common-validators.d.ts +0 -24
- package/dist/validation/lightweight-validators.d.ts +0 -113
- package/dist/validation/partial-validation-types.d.ts +0 -50
- package/dist/validation/partial-validator.d.ts +0 -6
- package/dist/validation/partial-warning-formatter.d.ts +0 -6
- package/dist/validation/validate-cli.d.ts +0 -41
- package/vocab/htmx/ar.js +0 -62
- package/vocab/htmx/bn.js +0 -65
- package/vocab/htmx/de.js +0 -83
- package/vocab/htmx/en.js +0 -24
- package/vocab/htmx/es.js +0 -79
- package/vocab/htmx/fr.js +0 -79
- package/vocab/htmx/he.js +0 -61
- package/vocab/htmx/hi.js +0 -81
- package/vocab/htmx/id.js +0 -76
- package/vocab/htmx/it.js +0 -79
- package/vocab/htmx/ja.js +0 -85
- package/vocab/htmx/ko.js +0 -81
- package/vocab/htmx/ms.js +0 -58
- package/vocab/htmx/pl.js +0 -80
- package/vocab/htmx/pt.js +0 -81
- package/vocab/htmx/qu.js +0 -83
- package/vocab/htmx/ru.js +0 -82
- package/vocab/htmx/sw.js +0 -79
- package/vocab/htmx/th.js +0 -67
- package/vocab/htmx/tl.js +0 -56
- package/vocab/htmx/tr.js +0 -86
- package/vocab/htmx/uk.js +0 -82
- package/vocab/htmx/vi.js +0 -59
- package/vocab/htmx/zh.js +0 -79
package/dist/reference/index.cjs
CHANGED
|
@@ -6,7 +6,6 @@ const commands = {
|
|
|
6
6
|
description: 'Toggle CSS classes, attributes, or properties on elements',
|
|
7
7
|
syntax: 'toggle .class [on target]',
|
|
8
8
|
category: 'dom',
|
|
9
|
-
availability: 'lite',
|
|
10
9
|
examples: ['toggle .active', 'toggle .hidden on #modal', 'toggle @disabled on <button/>'],
|
|
11
10
|
},
|
|
12
11
|
add: {
|
|
@@ -14,7 +13,6 @@ const commands = {
|
|
|
14
13
|
description: 'Add CSS classes, attributes, or styles to elements',
|
|
15
14
|
syntax: 'add .class [to target]',
|
|
16
15
|
category: 'dom',
|
|
17
|
-
availability: 'lite',
|
|
18
16
|
examples: ['add .highlight', 'add .active to #nav', 'add @required to <input/>'],
|
|
19
17
|
},
|
|
20
18
|
remove: {
|
|
@@ -22,7 +20,6 @@ const commands = {
|
|
|
22
20
|
description: 'Remove CSS classes, attributes, styles, or elements',
|
|
23
21
|
syntax: 'remove .class [from target]',
|
|
24
22
|
category: 'dom',
|
|
25
|
-
availability: 'lite',
|
|
26
23
|
examples: ['remove .loading', 'remove #temp-element', 'remove @disabled from me'],
|
|
27
24
|
},
|
|
28
25
|
hide: {
|
|
@@ -30,7 +27,6 @@ const commands = {
|
|
|
30
27
|
description: 'Hide elements by setting display:none',
|
|
31
28
|
syntax: 'hide [target]',
|
|
32
29
|
category: 'dom',
|
|
33
|
-
availability: 'lite',
|
|
34
30
|
examples: ['hide', 'hide #modal', 'hide .dropdown'],
|
|
35
31
|
},
|
|
36
32
|
show: {
|
|
@@ -38,7 +34,6 @@ const commands = {
|
|
|
38
34
|
description: 'Show hidden elements',
|
|
39
35
|
syntax: 'show [target]',
|
|
40
36
|
category: 'dom',
|
|
41
|
-
availability: 'lite',
|
|
42
37
|
examples: ['show', 'show #modal', 'show .dropdown'],
|
|
43
38
|
},
|
|
44
39
|
put: {
|
|
@@ -46,28 +41,25 @@ const commands = {
|
|
|
46
41
|
description: 'Set content or values',
|
|
47
42
|
syntax: 'put value into|before|after|at start of|at end of target',
|
|
48
43
|
category: 'dom',
|
|
49
|
-
availability: 'lite',
|
|
50
44
|
examples: [
|
|
51
45
|
'put "Hello" into #output',
|
|
52
46
|
'put it into me',
|
|
53
47
|
"put '<p>New</p>' into #container",
|
|
54
|
-
'put
|
|
48
|
+
'put "x" at end of me',
|
|
55
49
|
],
|
|
56
50
|
},
|
|
57
51
|
make: {
|
|
58
52
|
name: 'make',
|
|
59
53
|
description: 'Create new DOM elements',
|
|
60
|
-
syntax: 'make <tag/> [
|
|
54
|
+
syntax: 'make a <tag/> [called name]',
|
|
61
55
|
category: 'dom',
|
|
62
|
-
|
|
63
|
-
examples: ['make <div.card/>', 'make <button/> put into #toolbar'],
|
|
56
|
+
examples: ['make a <div.card/>', 'make a <button/> then put it into #toolbar'],
|
|
64
57
|
},
|
|
65
58
|
empty: {
|
|
66
59
|
name: 'empty',
|
|
67
60
|
description: 'Remove all children from an element (sets innerHTML to empty)',
|
|
68
61
|
syntax: 'empty [target]',
|
|
69
62
|
category: 'dom',
|
|
70
|
-
availability: 'lite-plus',
|
|
71
63
|
examples: ['empty me', 'empty #list', 'empty .results'],
|
|
72
64
|
},
|
|
73
65
|
open: {
|
|
@@ -75,7 +67,6 @@ const commands = {
|
|
|
75
67
|
description: 'Open a dialog (showModal/show), details element, or popover',
|
|
76
68
|
syntax: 'open [target] [as modal|non-modal]',
|
|
77
69
|
category: 'dom',
|
|
78
|
-
availability: 'full',
|
|
79
70
|
examples: ['open #myDialog', 'open #myDialog as non-modal', 'open #details', 'open #popup'],
|
|
80
71
|
},
|
|
81
72
|
close: {
|
|
@@ -83,7 +74,6 @@ const commands = {
|
|
|
83
74
|
description: 'Close a dialog, details element, or popover',
|
|
84
75
|
syntax: 'close [target]',
|
|
85
76
|
category: 'dom',
|
|
86
|
-
availability: 'full',
|
|
87
77
|
examples: ['close', 'close #myDialog', 'close #details'],
|
|
88
78
|
},
|
|
89
79
|
select: {
|
|
@@ -91,7 +81,6 @@ const commands = {
|
|
|
91
81
|
description: 'Select the text in an <input>/<textarea>, or select the contents of a DOM element',
|
|
92
82
|
syntax: 'select [target]',
|
|
93
83
|
category: 'dom',
|
|
94
|
-
availability: 'full',
|
|
95
84
|
examples: ['select #search', 'select <textarea/>', 'select me'],
|
|
96
85
|
},
|
|
97
86
|
reset: {
|
|
@@ -99,7 +88,6 @@ const commands = {
|
|
|
99
88
|
description: 'Reset a <form> to its default values (HTMLFormElement.reset())',
|
|
100
89
|
syntax: 'reset [target]',
|
|
101
90
|
category: 'dom',
|
|
102
|
-
availability: 'full',
|
|
103
91
|
examples: ['reset', 'reset #myForm', 'reset <form/>'],
|
|
104
92
|
},
|
|
105
93
|
clear: {
|
|
@@ -107,7 +95,6 @@ const commands = {
|
|
|
107
95
|
description: 'Reset a variable to null, or clear the value of a form field (<input>, <textarea>, <select>)',
|
|
108
96
|
syntax: 'clear <var|target>',
|
|
109
97
|
category: 'data',
|
|
110
|
-
availability: 'full',
|
|
111
98
|
examples: ['clear :count', 'clear myVar', 'clear #search', 'clear <textarea/>'],
|
|
112
99
|
},
|
|
113
100
|
breakpoint: {
|
|
@@ -115,7 +102,6 @@ const commands = {
|
|
|
115
102
|
description: 'Drop into the debugger (emits a debugger; statement)',
|
|
116
103
|
syntax: 'breakpoint',
|
|
117
104
|
category: 'utility',
|
|
118
|
-
availability: 'full',
|
|
119
105
|
examples: ['breakpoint', 'on click breakpoint'],
|
|
120
106
|
},
|
|
121
107
|
focus: {
|
|
@@ -123,55 +109,34 @@ const commands = {
|
|
|
123
109
|
description: 'Focus an element (calls HTMLElement.focus())',
|
|
124
110
|
syntax: 'focus [target]',
|
|
125
111
|
category: 'execution',
|
|
126
|
-
|
|
127
|
-
examples: ['focus #search', 'focus on <input/>', 'focus me'],
|
|
112
|
+
examples: ['focus #search', 'focus the first <input/>', 'focus me'],
|
|
128
113
|
},
|
|
129
114
|
blur: {
|
|
130
115
|
name: 'blur',
|
|
131
116
|
description: 'Remove focus from an element (calls HTMLElement.blur())',
|
|
132
117
|
syntax: 'blur [target]',
|
|
133
118
|
category: 'execution',
|
|
134
|
-
|
|
135
|
-
examples: ['blur #search', 'blur on <input/>', 'blur me'],
|
|
119
|
+
examples: ['blur #search', 'blur me'],
|
|
136
120
|
},
|
|
137
121
|
swap: {
|
|
138
122
|
name: 'swap',
|
|
139
|
-
description: '
|
|
140
|
-
syntax: 'swap
|
|
123
|
+
description: 'Exchange two elements, or a writable value with another value',
|
|
124
|
+
syntax: 'swap target with value',
|
|
141
125
|
category: 'dom',
|
|
142
|
-
|
|
143
|
-
examples: [
|
|
144
|
-
'swap "<p>New</p>" into #container',
|
|
145
|
-
'swap result into #list innerHTML',
|
|
146
|
-
'swap content into #panel outerHTML',
|
|
147
|
-
],
|
|
126
|
+
examples: ['swap #a with #b', 'swap innerHTML of #target with result'],
|
|
148
127
|
},
|
|
149
128
|
morph: {
|
|
150
129
|
name: 'morph',
|
|
151
130
|
description: 'Intelligently morph element content preserving state',
|
|
152
|
-
syntax: 'morph
|
|
153
|
-
category: 'dom',
|
|
154
|
-
availability: 'full',
|
|
155
|
-
examples: ['morph result into #content', 'morph "<div>New</div>" into me'],
|
|
156
|
-
},
|
|
157
|
-
processPartials: {
|
|
158
|
-
name: 'process partials',
|
|
159
|
-
description: 'Process <hx-partial> elements for multi-target swaps',
|
|
160
|
-
syntax: 'process partials in <content> [using view transition]',
|
|
131
|
+
syntax: 'morph target to content',
|
|
161
132
|
category: 'dom',
|
|
162
|
-
|
|
163
|
-
examples: [
|
|
164
|
-
'process partials in it',
|
|
165
|
-
'process partials in fetchedHtml',
|
|
166
|
-
'process partials in it using view transition',
|
|
167
|
-
],
|
|
133
|
+
examples: ['morph #content to result', 'morph me to "<div>New</div>"'],
|
|
168
134
|
},
|
|
169
135
|
wait: {
|
|
170
136
|
name: 'wait',
|
|
171
137
|
description: 'Pause execution for duration or until event',
|
|
172
138
|
syntax: 'wait duration | wait for event',
|
|
173
139
|
category: 'async',
|
|
174
|
-
availability: 'lite-plus',
|
|
175
140
|
examples: ['wait 1s', 'wait 500ms', 'wait for transitionend'],
|
|
176
141
|
},
|
|
177
142
|
fetch: {
|
|
@@ -179,7 +144,6 @@ const commands = {
|
|
|
179
144
|
description: 'Make HTTP requests',
|
|
180
145
|
syntax: 'fetch url [as type] [with options]',
|
|
181
146
|
category: 'async',
|
|
182
|
-
availability: 'hybrid',
|
|
183
147
|
examples: [
|
|
184
148
|
'fetch /api/data as json',
|
|
185
149
|
'fetch https://example.com/api as json',
|
|
@@ -193,23 +157,20 @@ const commands = {
|
|
|
193
157
|
description: 'Set variables or properties',
|
|
194
158
|
syntax: 'set target to value',
|
|
195
159
|
category: 'data',
|
|
196
|
-
availability: 'lite',
|
|
197
160
|
examples: ['set :count to 0', "set #input's value to ''", 'set x to 10'],
|
|
198
161
|
},
|
|
199
162
|
get: {
|
|
200
163
|
name: 'get',
|
|
201
164
|
description: 'Get property values',
|
|
202
|
-
syntax: 'get
|
|
165
|
+
syntax: 'get expression',
|
|
203
166
|
category: 'data',
|
|
204
|
-
|
|
205
|
-
examples: ['get value from #input', "get #element's textContent"],
|
|
167
|
+
examples: ["get #input's value", "get #element's textContent"],
|
|
206
168
|
},
|
|
207
169
|
increment: {
|
|
208
170
|
name: 'increment',
|
|
209
171
|
description: 'Increase numeric value',
|
|
210
172
|
syntax: 'increment target [by amount]',
|
|
211
173
|
category: 'data',
|
|
212
|
-
availability: 'lite-plus',
|
|
213
174
|
examples: ['increment :count', 'increment :score by 10'],
|
|
214
175
|
},
|
|
215
176
|
decrement: {
|
|
@@ -217,7 +178,6 @@ const commands = {
|
|
|
217
178
|
description: 'Decrease numeric value',
|
|
218
179
|
syntax: 'decrement target [by amount]',
|
|
219
180
|
category: 'data',
|
|
220
|
-
availability: 'lite-plus',
|
|
221
181
|
examples: ['decrement :count', 'decrement :lives by 1'],
|
|
222
182
|
},
|
|
223
183
|
default: {
|
|
@@ -225,7 +185,6 @@ const commands = {
|
|
|
225
185
|
description: 'Set default value if not already set',
|
|
226
186
|
syntax: 'default target to value',
|
|
227
187
|
category: 'data',
|
|
228
|
-
availability: 'full',
|
|
229
188
|
examples: ['default :count to 0', 'default :theme to "light"'],
|
|
230
189
|
},
|
|
231
190
|
log: {
|
|
@@ -233,87 +192,69 @@ const commands = {
|
|
|
233
192
|
description: 'Log values to console',
|
|
234
193
|
syntax: 'log value',
|
|
235
194
|
category: 'utility',
|
|
236
|
-
availability: 'lite-plus',
|
|
237
195
|
examples: ['log "Debug info"', 'log :count', 'log event'],
|
|
238
196
|
},
|
|
239
197
|
tell: {
|
|
240
198
|
name: 'tell',
|
|
241
199
|
description: 'Execute commands on another element',
|
|
242
|
-
syntax: 'tell target
|
|
200
|
+
syntax: 'tell target <commands> end',
|
|
243
201
|
category: 'utility',
|
|
244
|
-
|
|
245
|
-
examples: ['tell #other to add .active', 'tell <form/> to reset()'],
|
|
246
|
-
},
|
|
247
|
-
copy: {
|
|
248
|
-
name: 'copy',
|
|
249
|
-
description: 'Copy text to clipboard',
|
|
250
|
-
syntax: 'copy value',
|
|
251
|
-
category: 'utility',
|
|
252
|
-
availability: 'full',
|
|
253
|
-
examples: ['copy "Text"', "copy #input's value"],
|
|
202
|
+
examples: ['tell #other add .active end', 'tell <form/> call it.reset() end'],
|
|
254
203
|
},
|
|
255
204
|
pick: {
|
|
256
205
|
name: 'pick',
|
|
257
|
-
description: 'Pick
|
|
258
|
-
syntax: 'pick from
|
|
206
|
+
description: 'Pick a range of items or characters, or a regex match, out of a value',
|
|
207
|
+
syntax: 'pick items|characters start to end from value | pick match of regex from text',
|
|
259
208
|
category: 'utility',
|
|
260
|
-
|
|
261
|
-
examples: ['pick from <li/>', 'pick from ["a", "b", "c"]'],
|
|
209
|
+
examples: ['pick items 0 to 2 from :list', 'pick characters 0 to 3 from "hello"'],
|
|
262
210
|
},
|
|
263
|
-
beep: {
|
|
264
|
-
name: 'beep',
|
|
265
|
-
description: '
|
|
266
|
-
syntax: 'beep',
|
|
211
|
+
'beep!': {
|
|
212
|
+
name: 'beep!',
|
|
213
|
+
description: 'Log values to the console with their types (debugging)',
|
|
214
|
+
syntax: 'beep! value[, value]',
|
|
267
215
|
category: 'utility',
|
|
268
|
-
|
|
269
|
-
|
|
216
|
+
examples: ['beep! me', 'beep! :count, result'],
|
|
217
|
+
},
|
|
218
|
+
ask: {
|
|
219
|
+
name: 'ask',
|
|
220
|
+
description: 'Ask the user for text (window.prompt); the answer is in it',
|
|
221
|
+
syntax: 'ask message',
|
|
222
|
+
category: 'utility',
|
|
223
|
+
examples: ['ask "Your name?" then put it into #name'],
|
|
224
|
+
},
|
|
225
|
+
answer: {
|
|
226
|
+
name: 'answer',
|
|
227
|
+
description: 'Show a message (window.alert), or ask to confirm (window.confirm) and put the chosen value in it',
|
|
228
|
+
syntax: 'answer message [with yesValue or noValue]',
|
|
229
|
+
category: 'utility',
|
|
230
|
+
examples: ['answer "Saved"', 'answer "Delete it?" with "yes" or "no"'],
|
|
270
231
|
},
|
|
271
232
|
trigger: {
|
|
272
233
|
name: 'trigger',
|
|
273
234
|
description: 'Dispatch custom events',
|
|
274
235
|
syntax: 'trigger eventName [on target]',
|
|
275
236
|
category: 'events',
|
|
276
|
-
availability: 'lite-plus',
|
|
277
237
|
examples: ['trigger customEvent', 'trigger submit on <form/>', 'trigger click on #btn'],
|
|
278
238
|
},
|
|
279
239
|
send: {
|
|
280
240
|
name: 'send',
|
|
281
241
|
description: 'Send event with data to element',
|
|
282
|
-
syntax: 'send eventName [to target]
|
|
242
|
+
syntax: 'send eventName[(detail)] [to target]',
|
|
283
243
|
category: 'events',
|
|
284
|
-
|
|
285
|
-
examples: ['send update to #dashboard', 'send notify with {message: "Done"}'],
|
|
244
|
+
examples: ['send update to #dashboard', 'send notify(message: "Done") to #out'],
|
|
286
245
|
},
|
|
287
246
|
go: {
|
|
288
247
|
name: 'go',
|
|
289
248
|
description: 'Navigate to URL',
|
|
290
249
|
syntax: 'go to url',
|
|
291
250
|
category: 'navigation',
|
|
292
|
-
|
|
293
|
-
examples: ['go to /dashboard', 'go to url in new window'],
|
|
294
|
-
},
|
|
295
|
-
pushUrl: {
|
|
296
|
-
name: 'push url',
|
|
297
|
-
description: 'Update URL without page reload',
|
|
298
|
-
syntax: 'push url path',
|
|
299
|
-
category: 'navigation',
|
|
300
|
-
availability: 'hybrid',
|
|
301
|
-
examples: ['push url /page/2', 'push url /users/:id'],
|
|
302
|
-
},
|
|
303
|
-
replaceUrl: {
|
|
304
|
-
name: 'replace url',
|
|
305
|
-
description: 'Replace current URL in history',
|
|
306
|
-
syntax: 'replace url path',
|
|
307
|
-
category: 'navigation',
|
|
308
|
-
availability: 'hybrid',
|
|
309
|
-
examples: ['replace url /new-path'],
|
|
251
|
+
examples: ['go to /dashboard', 'go to url /help in new window'],
|
|
310
252
|
},
|
|
311
253
|
scroll: {
|
|
312
254
|
name: 'scroll',
|
|
313
255
|
description: 'Scroll an element into view (upstream _hyperscript 0.9.90 replacement for `go to top of`)',
|
|
314
256
|
syntax: 'scroll to [top|middle|bottom|nearest] [left|center|right] [of] target [smoothly|instantly] | scroll [target] [up|down|left|right] by n [px]',
|
|
315
257
|
category: 'navigation',
|
|
316
|
-
availability: 'full',
|
|
317
258
|
examples: [
|
|
318
259
|
'scroll to #top',
|
|
319
260
|
'scroll to bottom of #chat',
|
|
@@ -326,31 +267,27 @@ const commands = {
|
|
|
326
267
|
description: 'Conditional execution',
|
|
327
268
|
syntax: 'if condition ... [else ...] end',
|
|
328
269
|
category: 'control-flow',
|
|
329
|
-
|
|
330
|
-
examples: ['if :count > 0 add .active end', 'if me has .open hide else show end'],
|
|
331
|
-
},
|
|
332
|
-
unless: {
|
|
333
|
-
name: 'unless',
|
|
334
|
-
description: 'Negative conditional',
|
|
335
|
-
syntax: 'unless condition ... end',
|
|
336
|
-
category: 'control-flow',
|
|
337
|
-
availability: 'full',
|
|
338
|
-
examples: ['unless :loading show #content end'],
|
|
270
|
+
examples: ['if :count > 0 add .active end', 'if me matches .open hide me else show me end'],
|
|
339
271
|
},
|
|
340
272
|
repeat: {
|
|
341
273
|
name: 'repeat',
|
|
342
274
|
description: 'Loop execution',
|
|
343
|
-
syntax: 'repeat N times ... end | for
|
|
275
|
+
syntax: 'repeat N times ... end | repeat while condition ... end | repeat for item in collection ... end',
|
|
344
276
|
category: 'control-flow',
|
|
345
|
-
|
|
346
|
-
|
|
277
|
+
examples: ['repeat 3 times add .pulse end', 'repeat while :count < 10 increment :count end'],
|
|
278
|
+
},
|
|
279
|
+
for: {
|
|
280
|
+
name: 'for',
|
|
281
|
+
description: 'Loop over a collection',
|
|
282
|
+
syntax: 'for item in collection ... end',
|
|
283
|
+
category: 'control-flow',
|
|
284
|
+
examples: ['for item in <li/> add .done to item end'],
|
|
347
285
|
},
|
|
348
286
|
break: {
|
|
349
287
|
name: 'break',
|
|
350
288
|
description: 'Exit current loop',
|
|
351
289
|
syntax: 'break',
|
|
352
290
|
category: 'control-flow',
|
|
353
|
-
availability: 'hybrid',
|
|
354
291
|
examples: ['if :found break end'],
|
|
355
292
|
},
|
|
356
293
|
continue: {
|
|
@@ -358,15 +295,13 @@ const commands = {
|
|
|
358
295
|
description: 'Skip to next loop iteration',
|
|
359
296
|
syntax: 'continue',
|
|
360
297
|
category: 'control-flow',
|
|
361
|
-
|
|
362
|
-
examples: ['if item has .skip continue end'],
|
|
298
|
+
examples: ['if item matches .skip continue end'],
|
|
363
299
|
},
|
|
364
300
|
halt: {
|
|
365
301
|
name: 'halt',
|
|
366
302
|
description: 'Stop all execution',
|
|
367
303
|
syntax: 'halt',
|
|
368
304
|
category: 'control-flow',
|
|
369
|
-
availability: 'full',
|
|
370
305
|
examples: ['if :error halt end'],
|
|
371
306
|
},
|
|
372
307
|
return: {
|
|
@@ -374,7 +309,6 @@ const commands = {
|
|
|
374
309
|
description: 'Return value from function',
|
|
375
310
|
syntax: 'return [value]',
|
|
376
311
|
category: 'control-flow',
|
|
377
|
-
availability: 'full',
|
|
378
312
|
examples: ['return :result', 'return'],
|
|
379
313
|
},
|
|
380
314
|
exit: {
|
|
@@ -382,7 +316,6 @@ const commands = {
|
|
|
382
316
|
description: 'Exit current handler',
|
|
383
317
|
syntax: 'exit',
|
|
384
318
|
category: 'control-flow',
|
|
385
|
-
availability: 'full',
|
|
386
319
|
examples: ['if :done exit end'],
|
|
387
320
|
},
|
|
388
321
|
throw: {
|
|
@@ -390,50 +323,30 @@ const commands = {
|
|
|
390
323
|
description: 'Throw an error',
|
|
391
324
|
syntax: 'throw message',
|
|
392
325
|
category: 'control-flow',
|
|
393
|
-
availability: 'full',
|
|
394
326
|
examples: ['throw "Invalid input"'],
|
|
395
327
|
},
|
|
396
328
|
call: {
|
|
397
329
|
name: 'call',
|
|
398
330
|
description: 'Call a function or method',
|
|
399
|
-
syntax: 'call
|
|
331
|
+
syntax: 'call expression',
|
|
400
332
|
category: 'execution',
|
|
401
|
-
|
|
402
|
-
examples: ['call validate()', 'call reset() on <form/>'],
|
|
403
|
-
},
|
|
404
|
-
pseudo: {
|
|
405
|
-
name: 'pseudo',
|
|
406
|
-
description: 'Execute pseudo-command',
|
|
407
|
-
syntax: 'pseudo command',
|
|
408
|
-
category: 'execution',
|
|
409
|
-
availability: 'full',
|
|
410
|
-
examples: ['pseudo init'],
|
|
333
|
+
examples: ['call validate()', 'call #myForm.reset()'],
|
|
411
334
|
},
|
|
412
335
|
append: {
|
|
413
336
|
name: 'append',
|
|
414
337
|
description: 'Append content to element',
|
|
415
338
|
syntax: 'append content to target',
|
|
416
339
|
category: 'content',
|
|
417
|
-
availability: 'hybrid',
|
|
418
340
|
examples: ['append "<li>New</li>" to #list', 'append result to #container'],
|
|
419
341
|
},
|
|
420
|
-
prepend: {
|
|
421
|
-
name: 'prepend',
|
|
422
|
-
description: 'Prepend content to element (hyperfixi extension)',
|
|
423
|
-
syntax: 'prepend content to target',
|
|
424
|
-
category: 'content',
|
|
425
|
-
availability: 'hybrid',
|
|
426
|
-
examples: ['prepend "<li>First</li>" to #list', 'prepend result to #container'],
|
|
427
|
-
},
|
|
428
342
|
start: {
|
|
429
343
|
name: 'start',
|
|
430
344
|
description: 'Animate DOM mutations via document.startViewTransition (View Transitions API)',
|
|
431
|
-
syntax: 'start view transition [using
|
|
345
|
+
syntax: 'start view transition [using name] <body> end',
|
|
432
346
|
category: 'animation',
|
|
433
|
-
availability: 'full',
|
|
434
347
|
examples: [
|
|
435
348
|
'start view transition put result into #out end',
|
|
436
|
-
'start view transition using slide remove .open from #panel end',
|
|
349
|
+
'start view transition using "slide" remove .open from #panel end',
|
|
437
350
|
],
|
|
438
351
|
},
|
|
439
352
|
transition: {
|
|
@@ -441,7 +354,6 @@ const commands = {
|
|
|
441
354
|
description: 'Apply CSS transitions',
|
|
442
355
|
syntax: 'transition [target] property to value [over duration]',
|
|
443
356
|
category: 'animation',
|
|
444
|
-
availability: 'full',
|
|
445
357
|
examples: [
|
|
446
358
|
'transition opacity to 0 over 300ms',
|
|
447
359
|
"transition #box's *opacity to 0 over 300ms",
|
|
@@ -453,7 +365,6 @@ const commands = {
|
|
|
453
365
|
description: 'Measure element dimensions',
|
|
454
366
|
syntax: 'measure target',
|
|
455
367
|
category: 'animation',
|
|
456
|
-
availability: 'full',
|
|
457
368
|
examples: ['measure #element', 'measure me'],
|
|
458
369
|
},
|
|
459
370
|
settle: {
|
|
@@ -461,7 +372,6 @@ const commands = {
|
|
|
461
372
|
description: 'Wait for animations to complete',
|
|
462
373
|
syntax: 'settle',
|
|
463
374
|
category: 'animation',
|
|
464
|
-
availability: 'full',
|
|
465
375
|
examples: ['add .animate then settle then remove .animate'],
|
|
466
376
|
},
|
|
467
377
|
take: {
|
|
@@ -469,42 +379,26 @@ const commands = {
|
|
|
469
379
|
description: 'Take class from siblings (radio-button pattern)',
|
|
470
380
|
syntax: 'take .class [from <source>] [for <recipient>]',
|
|
471
381
|
category: 'animation',
|
|
472
|
-
availability: 'full',
|
|
473
382
|
examples: ['take .active from .tab for me', 'take .selected'],
|
|
474
383
|
},
|
|
475
384
|
js: {
|
|
476
385
|
name: 'js',
|
|
477
386
|
description: 'Execute inline JavaScript',
|
|
478
|
-
syntax: 'js(
|
|
387
|
+
syntax: 'js[(params)] <javascript> end',
|
|
479
388
|
category: 'advanced',
|
|
480
|
-
|
|
481
|
-
examples: ['js(console.log("hi"))', 'js(return Date.now())'],
|
|
482
|
-
},
|
|
483
|
-
install: {
|
|
484
|
-
name: 'install',
|
|
485
|
-
description: 'Install a behavior on element',
|
|
486
|
-
syntax: 'install BehaviorName',
|
|
487
|
-
category: 'behaviors',
|
|
488
|
-
availability: 'full',
|
|
489
|
-
examples: ['install Draggable', 'install Sortable'],
|
|
389
|
+
examples: ['js console.log("hi") end', 'js(x) return x * 2 end'],
|
|
490
390
|
},
|
|
491
391
|
render: {
|
|
492
392
|
name: 'render',
|
|
493
393
|
description: 'Render template with data',
|
|
494
|
-
syntax: 'render template with
|
|
394
|
+
syntax: 'render template [with name: value, ...]',
|
|
495
395
|
category: 'templates',
|
|
496
|
-
|
|
497
|
-
examples: ['render #userTemplate with :user'],
|
|
396
|
+
examples: ['render #userTemplate with user: :user'],
|
|
498
397
|
},
|
|
499
398
|
};
|
|
500
399
|
function getCommandsByCategory(category) {
|
|
501
400
|
return Object.values(commands).filter(cmd => cmd.category === category);
|
|
502
401
|
}
|
|
503
|
-
function getCommandsByAvailability(availability) {
|
|
504
|
-
const order = ['lite', 'lite-plus', 'hybrid', 'full'];
|
|
505
|
-
const availabilityIndex = order.indexOf(availability);
|
|
506
|
-
return Object.values(commands).filter(cmd => order.indexOf(cmd.availability) <= availabilityIndex);
|
|
507
|
-
}
|
|
508
402
|
function searchCommands(query) {
|
|
509
403
|
const q = query.toLowerCase();
|
|
510
404
|
return Object.values(commands).filter(cmd => cmd.name.toLowerCase().includes(q) ||
|
|
@@ -512,50 +406,17 @@ function searchCommands(query) {
|
|
|
512
406
|
cmd.syntax.toLowerCase().includes(q));
|
|
513
407
|
}
|
|
514
408
|
const bundles = [
|
|
515
|
-
{
|
|
516
|
-
name: 'hybrid-complete',
|
|
517
|
-
file: 'lokascript-hybrid-complete.js',
|
|
518
|
-
size: '7.3 KB',
|
|
519
|
-
commandCount: 21,
|
|
520
|
-
hasBlocks: true,
|
|
521
|
-
hasEventModifiers: true,
|
|
522
|
-
hasPositional: true,
|
|
523
|
-
useCase: 'Most apps (~85% hyperscript coverage)',
|
|
524
|
-
importPath: '@hyperfixi/core/browser/hybrid-complete',
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
name: 'hybrid-hx',
|
|
528
|
-
file: 'lokascript-hybrid-hx.js',
|
|
529
|
-
size: '9.7 KB',
|
|
530
|
-
commandCount: 21,
|
|
531
|
-
hasBlocks: true,
|
|
532
|
-
hasEventModifiers: true,
|
|
533
|
-
hasPositional: true,
|
|
534
|
-
useCase: 'htmx/fixi compatibility with hx-* attributes',
|
|
535
|
-
importPath: '@hyperfixi/core/browser/hybrid-hx',
|
|
536
|
-
},
|
|
537
409
|
{
|
|
538
410
|
name: 'browser',
|
|
539
|
-
file: '
|
|
540
|
-
size: '
|
|
541
|
-
commandCount:
|
|
411
|
+
file: 'hyperfixi.js',
|
|
412
|
+
size: '33.3 KB',
|
|
413
|
+
commandCount: 53,
|
|
542
414
|
hasBlocks: true,
|
|
543
415
|
hasEventModifiers: true,
|
|
544
416
|
hasPositional: true,
|
|
545
|
-
useCase: '
|
|
417
|
+
useCase: "Hyperscript, upstream's grammar, every module; the same file as hyperfixi-hs.js",
|
|
546
418
|
importPath: '@hyperfixi/core/browser',
|
|
547
419
|
},
|
|
548
|
-
{
|
|
549
|
-
name: 'multilingual',
|
|
550
|
-
file: 'lokascript-multilingual.js',
|
|
551
|
-
size: '64 KB',
|
|
552
|
-
commandCount: 43,
|
|
553
|
-
hasBlocks: true,
|
|
554
|
-
hasEventModifiers: true,
|
|
555
|
-
hasPositional: true,
|
|
556
|
-
useCase: 'Full features + multilingual API (no parser)',
|
|
557
|
-
importPath: '@hyperfixi/core/browser/multilingual',
|
|
558
|
-
},
|
|
559
420
|
];
|
|
560
421
|
function findBundleForFeatures(options) {
|
|
561
422
|
const { commands: requiredCommands = [], blocks, eventModifiers, positional } = options;
|
|
@@ -567,16 +428,7 @@ function findBundleForFeatures(options) {
|
|
|
567
428
|
continue;
|
|
568
429
|
if (positional && !bundle.hasPositional)
|
|
569
430
|
continue;
|
|
570
|
-
|
|
571
|
-
? 'lite'
|
|
572
|
-
: bundle.name === 'lite-plus'
|
|
573
|
-
? 'lite-plus'
|
|
574
|
-
: bundle.name.includes('hybrid')
|
|
575
|
-
? 'hybrid'
|
|
576
|
-
: 'full');
|
|
577
|
-
const availableNames = available.map(c => c.name);
|
|
578
|
-
const hasAllCommands = requiredCommands.every(cmd => availableNames.includes(cmd));
|
|
579
|
-
if (hasAllCommands) {
|
|
431
|
+
if (requiredCommands.every(cmd => cmd in commands)) {
|
|
580
432
|
return bundle;
|
|
581
433
|
}
|
|
582
434
|
}
|
|
@@ -598,7 +450,7 @@ const patterns = [
|
|
|
598
450
|
{
|
|
599
451
|
name: 'Form Submit',
|
|
600
452
|
description: 'Submit form via fetch, show result',
|
|
601
|
-
code: 'on submit halt the event then fetch /api/submit with method:"POST" body:me then put result into #response',
|
|
453
|
+
code: 'on submit halt the event then fetch /api/submit with {method:"POST", body: me as FormData} then put result into #response',
|
|
602
454
|
commands: ['fetch', 'put'],
|
|
603
455
|
},
|
|
604
456
|
{
|
|
@@ -610,7 +462,7 @@ const patterns = [
|
|
|
610
462
|
{
|
|
611
463
|
name: 'Debounced Input',
|
|
612
464
|
description: 'Search with debounce',
|
|
613
|
-
code: 'on input
|
|
465
|
+
code: 'on input debounced at 300ms fetch `/search?q=${my value}` as html then put result into #results',
|
|
614
466
|
commands: ['fetch', 'put'],
|
|
615
467
|
},
|
|
616
468
|
{
|
|
@@ -628,8 +480,8 @@ const patterns = [
|
|
|
628
480
|
{
|
|
629
481
|
name: 'Copy to Clipboard',
|
|
630
482
|
description: 'Copy text with feedback',
|
|
631
|
-
code: "on click
|
|
632
|
-
commands: ['
|
|
483
|
+
code: "on click call navigator.clipboard.writeText(#input's value) then add .copied then wait 1s then remove .copied",
|
|
484
|
+
commands: ['call', 'add', 'wait', 'remove'],
|
|
633
485
|
},
|
|
634
486
|
];
|
|
635
487
|
function searchPatterns(query) {
|
|
@@ -642,7 +494,6 @@ function searchPatterns(query) {
|
|
|
642
494
|
exports.bundles = bundles;
|
|
643
495
|
exports.commands = commands;
|
|
644
496
|
exports.findBundleForFeatures = findBundleForFeatures;
|
|
645
|
-
exports.getCommandsByAvailability = getCommandsByAvailability;
|
|
646
497
|
exports.getCommandsByCategory = getCommandsByCategory;
|
|
647
498
|
exports.patterns = patterns;
|
|
648
499
|
exports.searchCommands = searchCommands;
|
|
@@ -3,14 +3,11 @@ export interface CommandRef {
|
|
|
3
3
|
description: string;
|
|
4
4
|
syntax: string;
|
|
5
5
|
category: CommandCategory;
|
|
6
|
-
availability: BundleAvailability;
|
|
7
6
|
examples: string[];
|
|
8
7
|
}
|
|
9
8
|
export type CommandCategory = 'dom' | 'async' | 'data' | 'utility' | 'events' | 'navigation' | 'control-flow' | 'execution' | 'content' | 'animation' | 'advanced' | 'behaviors' | 'templates';
|
|
10
|
-
export type BundleAvailability = 'lite' | 'lite-plus' | 'hybrid' | 'full';
|
|
11
9
|
export declare const commands: Record<string, CommandRef>;
|
|
12
10
|
export declare function getCommandsByCategory(category: CommandCategory): CommandRef[];
|
|
13
|
-
export declare function getCommandsByAvailability(availability: BundleAvailability): CommandRef[];
|
|
14
11
|
export declare function searchCommands(query: string): CommandRef[];
|
|
15
12
|
export interface BundleRef {
|
|
16
13
|
name: string;
|