@getodk/xforms-engine 0.1.0 → 0.1.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/dist/.vite/manifest.json +1 -0
- package/dist/XFormDOM.d.ts +1 -0
- package/dist/XFormDataType.d.ts +2 -1
- package/dist/XFormDefinition.d.ts +1 -0
- package/dist/body/BodyDefinition.d.ts +3 -2
- package/dist/body/BodyElementDefinition.d.ts +5 -4
- package/dist/body/RepeatDefinition.d.ts +4 -3
- package/dist/body/UnsupportedBodyElementDefinition.d.ts +3 -2
- package/dist/body/control/ControlDefinition.d.ts +3 -2
- package/dist/body/control/InputDefinition.d.ts +1 -0
- package/dist/body/control/select/ItemDefinition.d.ts +4 -3
- package/dist/body/control/select/ItemsetDefinition.d.ts +4 -3
- package/dist/body/control/select/ItemsetNodesetContext.d.ts +3 -2
- package/dist/body/control/select/ItemsetNodesetExpression.d.ts +2 -1
- package/dist/body/control/select/ItemsetValueExpression.d.ts +2 -1
- package/dist/body/control/select/SelectDefinition.d.ts +5 -4
- package/dist/body/group/BaseGroupDefinition.d.ts +5 -4
- package/dist/body/group/LogicalGroupDefinition.d.ts +1 -0
- package/dist/body/group/PresentationGroupDefinition.d.ts +3 -2
- package/dist/body/group/RepeatGroupDefinition.d.ts +3 -2
- package/dist/body/group/StructuralGroupDefinition.d.ts +1 -0
- package/dist/body/text/HintDefinition.d.ts +4 -4
- package/dist/body/text/LabelDefinition.d.ts +7 -7
- package/dist/body/text/TextElementDefinition.d.ts +8 -7
- package/dist/body/text/TextElementOutputPart.d.ts +2 -1
- package/dist/body/text/TextElementPart.d.ts +5 -4
- package/dist/body/text/TextElementReferencePart.d.ts +2 -1
- package/dist/body/text/TextElementStaticPart.d.ts +2 -1
- package/dist/client/BaseNode.d.ts +4 -3
- package/dist/client/EngineConfig.d.ts +2 -1
- package/dist/client/GroupNode.d.ts +6 -5
- package/dist/client/RepeatInstanceNode.d.ts +7 -6
- package/dist/client/RepeatRangeNode.d.ts +7 -6
- package/dist/client/RootNode.d.ts +5 -4
- package/dist/client/SelectNode.d.ts +7 -6
- package/dist/client/StringNode.d.ts +6 -5
- package/dist/client/SubtreeNode.d.ts +5 -4
- package/dist/client/TextRange.d.ts +2 -1
- package/dist/client/hierarchy.d.ts +9 -8
- package/dist/client/index.d.ts +3 -2
- package/dist/expression/DependencyContext.d.ts +2 -1
- package/dist/expression/DependentExpression.d.ts +3 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1263 -1394
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +13 -13
- package/dist/instance/RepeatInstance.d.ts +14 -14
- package/dist/instance/RepeatRange.d.ts +16 -17
- package/dist/instance/Root.d.ts +17 -16
- package/dist/instance/SelectField.d.ts +16 -16
- package/dist/instance/StringField.d.ts +16 -16
- package/dist/instance/Subtree.d.ts +12 -12
- package/dist/instance/abstract/DescendantNode.d.ts +14 -14
- package/dist/instance/abstract/InstanceNode.d.ts +18 -17
- package/dist/instance/children.d.ts +2 -1
- package/dist/instance/hierarchy.d.ts +8 -7
- package/dist/instance/index.d.ts +4 -3
- package/dist/instance/internal-api/EvaluationContext.d.ts +5 -4
- package/dist/instance/internal-api/InstanceConfig.d.ts +3 -2
- package/dist/instance/internal-api/SubscribableDependency.d.ts +2 -1
- package/dist/instance/internal-api/TranslationContext.d.ts +2 -1
- package/dist/instance/internal-api/ValueContext.d.ts +4 -3
- package/dist/instance/resource.d.ts +3 -2
- package/dist/instance/text/TextChunk.d.ts +4 -3
- package/dist/instance/text/TextRange.d.ts +2 -1
- package/dist/lib/dom/query.d.ts +3 -2
- package/dist/lib/reactivity/createChildrenState.d.ts +4 -3
- package/dist/lib/reactivity/createComputedExpression.d.ts +4 -3
- package/dist/lib/reactivity/createSelectItems.d.ts +4 -3
- package/dist/lib/reactivity/createValueState.d.ts +3 -2
- package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +4 -3
- package/dist/lib/reactivity/node-state/createClientState.d.ts +7 -6
- package/dist/lib/reactivity/node-state/createCurrentState.d.ts +5 -4
- package/dist/lib/reactivity/node-state/createEngineState.d.ts +4 -3
- package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +7 -6
- package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +2 -1
- package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +3 -2
- package/dist/lib/reactivity/node-state/representations.d.ts +2 -1
- package/dist/lib/reactivity/scope.d.ts +2 -1
- package/dist/lib/reactivity/text/createFieldHint.d.ts +4 -3
- package/dist/lib/reactivity/text/createNodeLabel.d.ts +4 -3
- package/dist/lib/reactivity/text/createTextRange.d.ts +6 -5
- package/dist/lib/reactivity/types.d.ts +2 -1
- package/dist/lib/xpath/analysis.d.ts +2 -1
- package/dist/model/BindComputation.d.ts +2 -1
- package/dist/model/BindDefinition.d.ts +6 -5
- package/dist/model/DescendentNodeDefinition.d.ts +6 -5
- package/dist/model/ModelBindMap.d.ts +4 -3
- package/dist/model/ModelDefinition.d.ts +2 -1
- package/dist/model/NodeDefinition.d.ts +10 -9
- package/dist/model/RepeatInstanceDefinition.d.ts +3 -2
- package/dist/model/RepeatSequenceDefinition.d.ts +3 -2
- package/dist/model/RepeatTemplateDefinition.d.ts +4 -3
- package/dist/model/RootDefinition.d.ts +5 -4
- package/dist/model/SubtreeDefinition.d.ts +4 -3
- package/dist/model/ValueNodeDefinition.d.ts +5 -4
- package/dist/solid.js +1253 -1387
- package/dist/solid.js.map +1 -1
- package/package.json +14 -18
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ShallowMutable } from '../../../../../common/types/helpers.js';
|
|
2
|
+
|
|
2
3
|
declare const ENGINE_REPRESENTATION: unique symbol;
|
|
3
4
|
type ENGINE_REPRESENTATION = typeof ENGINE_REPRESENTATION;
|
|
4
5
|
declare const INTERNAL_CLIENT_REPRESENTATION: unique symbol;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
3
3
|
import { TextRange } from '../../../instance/text/TextRange.ts';
|
|
4
|
-
import
|
|
4
|
+
import { ValueNodeDefinition } from '../../../model/ValueNodeDefinition.ts';
|
|
5
|
+
|
|
5
6
|
export declare const createFieldHint: (context: EvaluationContext, definition: ValueNodeDefinition) => Accessor<TextRange<'hint'> | null>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
3
3
|
import { TextRange } from '../../../instance/text/TextRange.ts';
|
|
4
|
-
import
|
|
4
|
+
import { AnyNodeDefinition } from '../../../model/NodeDefinition.ts';
|
|
5
|
+
|
|
5
6
|
export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<'label'> | null>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { TextRange,
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { TextElementDefinition } from '../../../body/text/TextElementDefinition.ts';
|
|
3
|
+
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
+
import { TextRange, TextRole } from '../../../instance/text/TextRange.ts';
|
|
5
|
+
|
|
5
6
|
interface CreateTextRangeOptions<FallbackValue extends string | null> {
|
|
6
7
|
readonly fallbackValue?: FallbackValue;
|
|
7
8
|
}
|
|
@@ -15,5 +16,5 @@ type ComputedTextRange<Role extends TextRole, Definition extends TextElementDefi
|
|
|
15
16
|
*
|
|
16
17
|
* @todo This does not yet handle itext translations **with** outputs!
|
|
17
18
|
*/
|
|
18
|
-
export declare const createTextRange: <Role extends TextRole, Definition extends TextElementDefinition<Role> | null, FallbackValue extends string | null = null>(context: EvaluationContext, role: Role, definition: Definition, options?: CreateTextRangeOptions<FallbackValue>
|
|
19
|
+
export declare const createTextRange: <Role extends TextRole, Definition extends TextElementDefinition<Role> | null, FallbackValue extends string | null = null>(context: EvaluationContext, role: Role, definition: Definition, options?: CreateTextRangeOptions<FallbackValue>) => ComputedTextRange<Role, Definition, FallbackValue>;
|
|
19
20
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnySyntaxNode } from '@getodk/xpath/static/grammar/SyntaxNode.js';
|
|
2
|
+
|
|
2
3
|
export type SingleChildNode = Extract<AnySyntaxNode, {
|
|
3
4
|
readonly children: readonly [AnySyntaxNode];
|
|
4
5
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DependentExpression } from '../expression/DependentExpression.ts';
|
|
2
|
-
import
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
+
|
|
3
4
|
declare const defaultBindComputationExpressions: {
|
|
4
5
|
readonly calculate: null;
|
|
5
6
|
readonly constraint: "true()";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { XFormDataType } from '../XFormDataType.ts';
|
|
2
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
3
3
|
import { DependencyContext } from '../expression/DependencyContext.ts';
|
|
4
|
-
import
|
|
4
|
+
import { DependentExpression } from '../expression/DependentExpression.ts';
|
|
5
5
|
import { BindComputation } from './BindComputation.ts';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { BindElement } from './BindElement.ts';
|
|
7
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
8
|
+
|
|
8
9
|
export declare class BindDefinition extends DependencyContext {
|
|
9
10
|
readonly form: XFormDefinition;
|
|
10
11
|
protected readonly model: ModelDefinition;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { RepeatDefinition } from '../body/RepeatDefinition.ts';
|
|
3
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
|
+
import { ModelNode, NodeChildren, NodeDefaultValue, NodeDefinition, NodeDefinitionType, NodeInstances, NodeParent } from './NodeDefinition.ts';
|
|
5
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
6
|
+
|
|
6
7
|
export type DescendentNodeType = Exclude<NodeDefinitionType, 'root'>;
|
|
7
8
|
type DescendentNodeBodyElement = AnyBodyElementDefinition | RepeatDefinition;
|
|
8
9
|
export declare abstract class DescendentNodeDefinition<Type extends DescendentNodeType, BodyElement extends DescendentNodeBodyElement | null = DescendentNodeBodyElement | null> implements NodeDefinition<Type> {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
2
|
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { BindNodeset } from './BindElement.ts';
|
|
4
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
5
|
+
|
|
5
6
|
type TopologicalSortIndex = number;
|
|
6
7
|
export type SortedNodesetIndexes = ReadonlyMap<BindNodeset, TopologicalSortIndex>;
|
|
7
8
|
export declare class ModelBindMap extends Map<BindNodeset, BindDefinition> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
2
|
import { ModelBindMap } from './ModelBindMap.ts';
|
|
3
3
|
import { RootDefinition } from './RootDefinition.ts';
|
|
4
|
+
|
|
4
5
|
export declare class ModelDefinition {
|
|
5
6
|
readonly form: XFormDefinition;
|
|
6
7
|
readonly binds: ModelBindMap;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { RepeatDefinition } from '../body/RepeatDefinition.ts';
|
|
3
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
|
+
import { RepeatInstanceDefinition } from './RepeatInstanceDefinition.ts';
|
|
5
|
+
import { RepeatSequenceDefinition } from './RepeatSequenceDefinition.ts';
|
|
6
|
+
import { RepeatTemplateDefinition } from './RepeatTemplateDefinition.ts';
|
|
7
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
8
|
+
import { SubtreeDefinition } from './SubtreeDefinition.ts';
|
|
9
|
+
import { ValueNodeDefinition } from './ValueNodeDefinition.ts';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Corresponds to the model/entry DOM root node, i.e.:
|
|
12
13
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RepeatDefinition } from '../body/RepeatDefinition.ts';
|
|
2
2
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { ChildNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
4
|
+
import { RepeatSequenceDefinition } from './RepeatSequenceDefinition.ts';
|
|
5
|
+
|
|
5
6
|
export declare class RepeatInstanceDefinition extends DescendentNodeDefinition<'repeat-instance', RepeatDefinition> implements NodeDefinition<'repeat-instance'> {
|
|
6
7
|
protected readonly sequence: RepeatSequenceDefinition;
|
|
7
8
|
readonly node: Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { RepeatGroupDefinition } from '../body/group/RepeatGroupDefinition.ts';
|
|
2
|
-
import
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
4
|
+
import { NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
5
|
import { RepeatInstanceDefinition } from './RepeatInstanceDefinition.ts';
|
|
6
6
|
import { RepeatTemplateDefinition } from './RepeatTemplateDefinition.ts';
|
|
7
|
+
|
|
7
8
|
export declare class RepeatSequenceDefinition extends DescendentNodeDefinition<'repeat-sequence', RepeatGroupDefinition> implements NodeDefinition<'repeat-sequence'> {
|
|
8
9
|
static createTemplateElement(instanceElement: Element): Element;
|
|
9
10
|
static createInstanceElement(templateElement: Element): Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JAVAROSA_NAMESPACE_URI } from '../../../common/src/constants/xmlns.ts';
|
|
2
|
-
import
|
|
2
|
+
import { RepeatDefinition } from '../body/RepeatDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { ChildNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
import { RepeatSequenceDefinition } from './RepeatSequenceDefinition.ts';
|
|
6
|
+
|
|
6
7
|
interface ExplicitRepeatTemplateElement extends Element {
|
|
7
8
|
getAttributeNS(namespaceURI: typeof JAVAROSA_NAMESPACE_URI, name: 'template'): string;
|
|
8
9
|
getAttributeNS(namespaceURI: string | null, name: string): string | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
4
|
+
import { ChildNodeDefinition, NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
|
|
5
6
|
export declare class RootDefinition implements NodeDefinition<'root'> {
|
|
6
7
|
protected readonly form: XFormDefinition;
|
|
7
8
|
protected readonly model: ModelDefinition;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition, NonRepeatGroupElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
4
|
+
import { ChildNodeDefinition, NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
|
|
5
6
|
export declare class SubtreeDefinition extends DescendentNodeDefinition<'subtree', NonRepeatGroupElementDefinition | null> implements NodeDefinition<'subtree'> {
|
|
6
7
|
readonly node: Element;
|
|
7
8
|
readonly type = "subtree";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { AnyControlDefinition } from '../body/control/ControlDefinition.ts';
|
|
3
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
4
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
5
|
-
import
|
|
5
|
+
import { NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
6
|
+
|
|
6
7
|
export declare class ValueNodeDefinition extends DescendentNodeDefinition<'value-node', AnyControlDefinition | null> implements NodeDefinition<'value-node'> {
|
|
7
8
|
readonly node: Element;
|
|
8
9
|
readonly type = "value-node";
|