svelte 3.30.0 → 3.31.2
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/CHANGELOG.md +27 -0
- package/LICENSE +1 -1
- package/compiler.js +349 -146
- package/compiler.js.map +1 -1
- package/compiler.mjs +349 -146
- package/compiler.mjs.map +1 -1
- package/index.js +12 -0
- package/index.mjs +1 -1
- package/internal/index.js +48 -4
- package/internal/index.mjs +48 -5
- package/package.json +8 -8
- package/transition/index.js +10 -10
- package/transition/index.mjs +10 -10
- package/types/compiler/compile/nodes/Action.d.ts +4 -1
- package/types/compiler/compile/nodes/Animation.d.ts +4 -1
- package/types/compiler/compile/nodes/Attribute.d.ts +2 -1
- package/types/compiler/compile/nodes/AwaitBlock.d.ts +1 -1
- package/types/compiler/compile/nodes/Binding.d.ts +5 -1
- package/types/compiler/compile/nodes/Body.d.ts +4 -1
- package/types/compiler/compile/nodes/Class.d.ts +4 -1
- package/types/compiler/compile/nodes/Comment.d.ts +4 -1
- package/types/compiler/compile/nodes/DebugTag.d.ts +5 -1
- package/types/compiler/compile/nodes/EachBlock.d.ts +3 -1
- package/types/compiler/compile/nodes/Element.d.ts +1 -1
- package/types/compiler/compile/nodes/ElseBlock.d.ts +4 -1
- package/types/compiler/compile/nodes/EventHandler.d.ts +4 -2
- package/types/compiler/compile/nodes/Fragment.d.ts +2 -1
- package/types/compiler/compile/nodes/Head.d.ts +4 -1
- package/types/compiler/compile/nodes/IfBlock.d.ts +5 -1
- package/types/compiler/compile/nodes/InlineComponent.d.ts +2 -1
- package/types/compiler/compile/nodes/KeyBlock.d.ts +5 -1
- package/types/compiler/compile/nodes/Let.d.ts +3 -1
- package/types/compiler/compile/nodes/PendingBlock.d.ts +5 -1
- package/types/compiler/compile/nodes/Slot.d.ts +2 -1
- package/types/compiler/compile/nodes/Text.d.ts +2 -1
- package/types/compiler/compile/nodes/Title.d.ts +3 -1
- package/types/compiler/compile/nodes/Transition.d.ts +4 -1
- package/types/compiler/compile/nodes/Window.d.ts +4 -1
- package/types/compiler/compile/nodes/shared/Expression.d.ts +2 -2
- package/types/compiler/compile/nodes/shared/Node.d.ts +2 -1
- package/types/compiler/compile/nodes/shared/is_contextual.d.ts +3 -0
- package/types/compiler/compile/render_dom/Block.d.ts +1 -0
- package/types/compiler/compile/render_dom/Renderer.d.ts +1 -0
- package/types/compiler/compile/render_dom/invalidate.d.ts +1 -0
- package/types/compiler/compile/render_dom/wrappers/EachBlock.d.ts +2 -2
- package/types/compiler/compile/utils/get_slot_data.d.ts +1 -1
- package/types/compiler/utils/string_with_sourcemap.d.ts +1 -1
- package/types/runtime/index.d.ts +1 -1
- package/types/runtime/internal/Component.d.ts +7 -4
- package/types/runtime/internal/dev.d.ts +63 -4
package/index.js
CHANGED
|
@@ -12,6 +12,12 @@ Object.defineProperty(exports, 'SvelteComponent', {
|
|
|
12
12
|
return internal.SvelteComponentDev;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
Object.defineProperty(exports, 'SvelteComponentTyped', {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return internal.SvelteComponentTyped;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
15
21
|
Object.defineProperty(exports, 'afterUpdate', {
|
|
16
22
|
enumerable: true,
|
|
17
23
|
get: function () {
|
|
@@ -36,6 +42,12 @@ Object.defineProperty(exports, 'getContext', {
|
|
|
36
42
|
return internal.getContext;
|
|
37
43
|
}
|
|
38
44
|
});
|
|
45
|
+
Object.defineProperty(exports, 'hasContext', {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () {
|
|
48
|
+
return internal.hasContext;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
39
51
|
Object.defineProperty(exports, 'onDestroy', {
|
|
40
52
|
enumerable: true,
|
|
41
53
|
get: function () {
|
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SvelteComponentDev as SvelteComponent, afterUpdate, beforeUpdate, createEventDispatcher, getContext, onDestroy, onMount, setContext, tick } from './internal/index.mjs';
|
|
1
|
+
export { SvelteComponentDev as SvelteComponent, SvelteComponentTyped, afterUpdate, beforeUpdate, createEventDispatcher, getContext, hasContext, onDestroy, onMount, setContext, tick } from './internal/index.mjs';
|
package/internal/index.js
CHANGED
|
@@ -423,13 +423,12 @@ function is_crossorigin() {
|
|
|
423
423
|
}
|
|
424
424
|
function add_resize_listener(node, fn) {
|
|
425
425
|
const computed_style = getComputedStyle(node);
|
|
426
|
-
const z_index = (parseInt(computed_style.zIndex) || 0) - 1;
|
|
427
426
|
if (computed_style.position === 'static') {
|
|
428
427
|
node.style.position = 'relative';
|
|
429
428
|
}
|
|
430
429
|
const iframe = element('iframe');
|
|
431
430
|
iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +
|
|
432
|
-
|
|
431
|
+
'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');
|
|
433
432
|
iframe.setAttribute('aria-hidden', 'true');
|
|
434
433
|
iframe.tabIndex = -1;
|
|
435
434
|
const crossorigin = is_crossorigin();
|
|
@@ -1064,7 +1063,9 @@ function handle_promise(promise, info) {
|
|
|
1064
1063
|
if (i !== index && block) {
|
|
1065
1064
|
group_outros();
|
|
1066
1065
|
transition_out(block, 1, 1, () => {
|
|
1067
|
-
info.blocks[i]
|
|
1066
|
+
if (info.blocks[i] === block) {
|
|
1067
|
+
info.blocks[i] = null;
|
|
1068
|
+
}
|
|
1068
1069
|
});
|
|
1069
1070
|
check_outros();
|
|
1070
1071
|
}
|
|
@@ -1544,6 +1545,9 @@ if (typeof HTMLElement === 'function') {
|
|
|
1544
1545
|
}
|
|
1545
1546
|
};
|
|
1546
1547
|
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Base class for Svelte components. Used when dev=false.
|
|
1550
|
+
*/
|
|
1547
1551
|
class SvelteComponent {
|
|
1548
1552
|
$destroy() {
|
|
1549
1553
|
destroy_component(this, 1);
|
|
@@ -1568,7 +1572,7 @@ class SvelteComponent {
|
|
|
1568
1572
|
}
|
|
1569
1573
|
|
|
1570
1574
|
function dispatch_dev(type, detail) {
|
|
1571
|
-
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.
|
|
1575
|
+
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.31.2' }, detail)));
|
|
1572
1576
|
}
|
|
1573
1577
|
function append_dev(target, node) {
|
|
1574
1578
|
dispatch_dev('SvelteDOMInsert', { target, node });
|
|
@@ -1648,6 +1652,9 @@ function validate_slots(name, slot, keys) {
|
|
|
1648
1652
|
}
|
|
1649
1653
|
}
|
|
1650
1654
|
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
|
1657
|
+
*/
|
|
1651
1658
|
class SvelteComponentDev extends SvelteComponent {
|
|
1652
1659
|
constructor(options) {
|
|
1653
1660
|
if (!options || (!options.target && !options.$$inline)) {
|
|
@@ -1664,6 +1671,42 @@ class SvelteComponentDev extends SvelteComponent {
|
|
|
1664
1671
|
$capture_state() { }
|
|
1665
1672
|
$inject_state() { }
|
|
1666
1673
|
}
|
|
1674
|
+
/**
|
|
1675
|
+
* Base class to create strongly typed Svelte components.
|
|
1676
|
+
* This only exists for typing purposes and should be used in `.d.ts` files.
|
|
1677
|
+
*
|
|
1678
|
+
* ### Example:
|
|
1679
|
+
*
|
|
1680
|
+
* You have component library on npm called `component-library`, from which
|
|
1681
|
+
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
|
1682
|
+
* you want to provide typings. Therefore you create a `index.d.ts`:
|
|
1683
|
+
* ```ts
|
|
1684
|
+
* import { SvelteComponentTyped } from "svelte";
|
|
1685
|
+
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
|
1686
|
+
* ```
|
|
1687
|
+
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
|
1688
|
+
* to provide intellisense and to use the component like this in a Svelte file
|
|
1689
|
+
* with TypeScript:
|
|
1690
|
+
* ```svelte
|
|
1691
|
+
* <script lang="ts">
|
|
1692
|
+
* import { MyComponent } from "component-library";
|
|
1693
|
+
* </script>
|
|
1694
|
+
* <MyComponent foo={'bar'} />
|
|
1695
|
+
* ```
|
|
1696
|
+
*
|
|
1697
|
+
* #### Why not make this part of `SvelteComponent(Dev)`?
|
|
1698
|
+
* Because
|
|
1699
|
+
* ```ts
|
|
1700
|
+
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
|
1701
|
+
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
|
1702
|
+
* ```
|
|
1703
|
+
* will throw a type error, so we need to seperate the more strictly typed class.
|
|
1704
|
+
*/
|
|
1705
|
+
class SvelteComponentTyped extends SvelteComponentDev {
|
|
1706
|
+
constructor(options) {
|
|
1707
|
+
super(options);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1667
1710
|
function loop_guard(timeout) {
|
|
1668
1711
|
const start = Date.now();
|
|
1669
1712
|
return () => {
|
|
@@ -1676,6 +1719,7 @@ function loop_guard(timeout) {
|
|
|
1676
1719
|
exports.HtmlTag = HtmlTag;
|
|
1677
1720
|
exports.SvelteComponent = SvelteComponent;
|
|
1678
1721
|
exports.SvelteComponentDev = SvelteComponentDev;
|
|
1722
|
+
exports.SvelteComponentTyped = SvelteComponentTyped;
|
|
1679
1723
|
exports.action_destroyer = action_destroyer;
|
|
1680
1724
|
exports.add_attribute = add_attribute;
|
|
1681
1725
|
exports.add_classes = add_classes;
|
package/internal/index.mjs
CHANGED
|
@@ -419,13 +419,12 @@ function is_crossorigin() {
|
|
|
419
419
|
}
|
|
420
420
|
function add_resize_listener(node, fn) {
|
|
421
421
|
const computed_style = getComputedStyle(node);
|
|
422
|
-
const z_index = (parseInt(computed_style.zIndex) || 0) - 1;
|
|
423
422
|
if (computed_style.position === 'static') {
|
|
424
423
|
node.style.position = 'relative';
|
|
425
424
|
}
|
|
426
425
|
const iframe = element('iframe');
|
|
427
426
|
iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +
|
|
428
|
-
|
|
427
|
+
'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');
|
|
429
428
|
iframe.setAttribute('aria-hidden', 'true');
|
|
430
429
|
iframe.tabIndex = -1;
|
|
431
430
|
const crossorigin = is_crossorigin();
|
|
@@ -1061,7 +1060,9 @@ function handle_promise(promise, info) {
|
|
|
1061
1060
|
if (i !== index && block) {
|
|
1062
1061
|
group_outros();
|
|
1063
1062
|
transition_out(block, 1, 1, () => {
|
|
1064
|
-
info.blocks[i]
|
|
1063
|
+
if (info.blocks[i] === block) {
|
|
1064
|
+
info.blocks[i] = null;
|
|
1065
|
+
}
|
|
1065
1066
|
});
|
|
1066
1067
|
check_outros();
|
|
1067
1068
|
}
|
|
@@ -1542,6 +1543,9 @@ if (typeof HTMLElement === 'function') {
|
|
|
1542
1543
|
}
|
|
1543
1544
|
};
|
|
1544
1545
|
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Base class for Svelte components. Used when dev=false.
|
|
1548
|
+
*/
|
|
1545
1549
|
class SvelteComponent {
|
|
1546
1550
|
$destroy() {
|
|
1547
1551
|
destroy_component(this, 1);
|
|
@@ -1566,7 +1570,7 @@ class SvelteComponent {
|
|
|
1566
1570
|
}
|
|
1567
1571
|
|
|
1568
1572
|
function dispatch_dev(type, detail) {
|
|
1569
|
-
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.
|
|
1573
|
+
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.31.2' }, detail)));
|
|
1570
1574
|
}
|
|
1571
1575
|
function append_dev(target, node) {
|
|
1572
1576
|
dispatch_dev('SvelteDOMInsert', { target, node });
|
|
@@ -1646,6 +1650,9 @@ function validate_slots(name, slot, keys) {
|
|
|
1646
1650
|
}
|
|
1647
1651
|
}
|
|
1648
1652
|
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
|
1655
|
+
*/
|
|
1649
1656
|
class SvelteComponentDev extends SvelteComponent {
|
|
1650
1657
|
constructor(options) {
|
|
1651
1658
|
if (!options || (!options.target && !options.$$inline)) {
|
|
@@ -1662,6 +1669,42 @@ class SvelteComponentDev extends SvelteComponent {
|
|
|
1662
1669
|
$capture_state() { }
|
|
1663
1670
|
$inject_state() { }
|
|
1664
1671
|
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Base class to create strongly typed Svelte components.
|
|
1674
|
+
* This only exists for typing purposes and should be used in `.d.ts` files.
|
|
1675
|
+
*
|
|
1676
|
+
* ### Example:
|
|
1677
|
+
*
|
|
1678
|
+
* You have component library on npm called `component-library`, from which
|
|
1679
|
+
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
|
1680
|
+
* you want to provide typings. Therefore you create a `index.d.ts`:
|
|
1681
|
+
* ```ts
|
|
1682
|
+
* import { SvelteComponentTyped } from "svelte";
|
|
1683
|
+
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
|
1684
|
+
* ```
|
|
1685
|
+
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
|
1686
|
+
* to provide intellisense and to use the component like this in a Svelte file
|
|
1687
|
+
* with TypeScript:
|
|
1688
|
+
* ```svelte
|
|
1689
|
+
* <script lang="ts">
|
|
1690
|
+
* import { MyComponent } from "component-library";
|
|
1691
|
+
* </script>
|
|
1692
|
+
* <MyComponent foo={'bar'} />
|
|
1693
|
+
* ```
|
|
1694
|
+
*
|
|
1695
|
+
* #### Why not make this part of `SvelteComponent(Dev)`?
|
|
1696
|
+
* Because
|
|
1697
|
+
* ```ts
|
|
1698
|
+
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
|
1699
|
+
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
|
1700
|
+
* ```
|
|
1701
|
+
* will throw a type error, so we need to seperate the more strictly typed class.
|
|
1702
|
+
*/
|
|
1703
|
+
class SvelteComponentTyped extends SvelteComponentDev {
|
|
1704
|
+
constructor(options) {
|
|
1705
|
+
super(options);
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1665
1708
|
function loop_guard(timeout) {
|
|
1666
1709
|
const start = Date.now();
|
|
1667
1710
|
return () => {
|
|
@@ -1671,4 +1714,4 @@ function loop_guard(timeout) {
|
|
|
1671
1714
|
};
|
|
1672
1715
|
}
|
|
1673
1716
|
|
|
1674
|
-
export { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_custom_elements_slots, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, update_slot_spread, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };
|
|
1717
|
+
export { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_custom_elements_slots, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, update_slot_spread, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.2",
|
|
4
4
|
"description": "Cybernetically enhanced web apps",
|
|
5
5
|
"module": "index.mjs",
|
|
6
6
|
"main": "index",
|
|
@@ -99,22 +99,22 @@
|
|
|
99
99
|
"@rollup/plugin-json": "^4.0.1",
|
|
100
100
|
"@rollup/plugin-node-resolve": "^6.0.0",
|
|
101
101
|
"@rollup/plugin-replace": "^2.3.0",
|
|
102
|
-
"@rollup/plugin-sucrase": "^3.
|
|
102
|
+
"@rollup/plugin-sucrase": "^3.1.0",
|
|
103
103
|
"@rollup/plugin-typescript": "^2.0.1",
|
|
104
104
|
"@rollup/plugin-virtual": "^2.0.0",
|
|
105
105
|
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.6.0",
|
|
106
106
|
"@types/mocha": "^7.0.0",
|
|
107
107
|
"@types/node": "^8.10.53",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
109
|
-
"@typescript-eslint/parser": "^
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^4.9.0",
|
|
109
|
+
"@typescript-eslint/parser": "^4.9.0",
|
|
110
110
|
"acorn": "^7.4.0",
|
|
111
111
|
"agadoo": "^1.1.0",
|
|
112
112
|
"c8": "^5.0.1",
|
|
113
113
|
"code-red": "^0.1.4",
|
|
114
114
|
"codecov": "^3.5.0",
|
|
115
115
|
"css-tree": "1.0.0-alpha22",
|
|
116
|
-
"eslint": "^7.
|
|
117
|
-
"eslint-plugin-import": "^2.
|
|
116
|
+
"eslint": "^7.15.0",
|
|
117
|
+
"eslint-plugin-import": "^2.22.1",
|
|
118
118
|
"eslint-plugin-svelte3": "^2.7.3",
|
|
119
119
|
"estree-walker": "^1.0.0",
|
|
120
120
|
"is-reference": "^1.1.4",
|
|
@@ -130,8 +130,8 @@
|
|
|
130
130
|
"source-map-support": "^0.5.13",
|
|
131
131
|
"sourcemap-codec": "^1.4.8",
|
|
132
132
|
"tiny-glob": "^0.2.6",
|
|
133
|
-
"tslib": "^
|
|
134
|
-
"typescript": "^3.5
|
|
133
|
+
"tslib": "^2.0.3",
|
|
134
|
+
"typescript": "^3.7.5"
|
|
135
135
|
},
|
|
136
136
|
"nyc": {
|
|
137
137
|
"include": [
|
package/transition/index.js
CHANGED
|
@@ -6,18 +6,18 @@ var easing = require('../easing/index.js');
|
|
|
6
6
|
var internal = require('../internal/index.js');
|
|
7
7
|
|
|
8
8
|
/*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
Copyright (c) Microsoft Corporation.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
17
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12
|
+
purpose with or without fee is hereby granted.
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
21
21
|
***************************************************************************** */
|
|
22
22
|
|
|
23
23
|
function __rest(s, e) {
|
package/transition/index.mjs
CHANGED
|
@@ -2,18 +2,18 @@ import { cubicInOut, linear, cubicOut } from '../easing/index.mjs';
|
|
|
2
2
|
import { is_function, assign } from '../internal/index.mjs';
|
|
3
3
|
|
|
4
4
|
/*! *****************************************************************************
|
|
5
|
-
Copyright (c) Microsoft Corporation.
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
7
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
8
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
Copyright (c) Microsoft Corporation.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
13
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted.
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
17
17
|
***************************************************************************** */
|
|
18
18
|
|
|
19
19
|
function __rest(s, e) {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
3
|
import Component from '../Component';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { Directive } from '../../interfaces';
|
|
4
6
|
export default class Action extends Node {
|
|
5
7
|
type: 'Action';
|
|
6
8
|
name: string;
|
|
7
9
|
expression: Expression;
|
|
8
10
|
uses_context: boolean;
|
|
9
|
-
|
|
11
|
+
template_scope: TemplateScope;
|
|
12
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: Directive);
|
|
10
13
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
3
|
import Component from '../Component';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { TemplateNode } from '../../interfaces';
|
|
6
|
+
import Element from './Element';
|
|
4
7
|
export default class Animation extends Node {
|
|
5
8
|
type: 'Animation';
|
|
6
9
|
name: string;
|
|
7
10
|
expression: Expression;
|
|
8
|
-
constructor(component: Component, parent:
|
|
11
|
+
constructor(component: Component, parent: Element, scope: TemplateScope, info: TemplateNode);
|
|
9
12
|
}
|
|
@@ -4,6 +4,7 @@ import Element from './Element';
|
|
|
4
4
|
import Text from './Text';
|
|
5
5
|
import Expression from './shared/Expression';
|
|
6
6
|
import TemplateScope from './shared/TemplateScope';
|
|
7
|
+
import { TemplateNode } from '../../interfaces';
|
|
7
8
|
export default class Attribute extends Node {
|
|
8
9
|
type: 'Attribute' | 'Spread';
|
|
9
10
|
start: number;
|
|
@@ -18,7 +19,7 @@ export default class Attribute extends Node {
|
|
|
18
19
|
expression?: Expression;
|
|
19
20
|
chunks: Array<Text | Expression>;
|
|
20
21
|
dependencies: Set<string>;
|
|
21
|
-
constructor(component:
|
|
22
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
22
23
|
get_dependencies(): string[];
|
|
23
24
|
get_value(block: any): import("estree").Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | {
|
|
24
25
|
type: string;
|
|
@@ -18,5 +18,5 @@ export default class AwaitBlock extends Node {
|
|
|
18
18
|
pending: PendingBlock;
|
|
19
19
|
then: ThenBlock;
|
|
20
20
|
catch: CatchBlock;
|
|
21
|
-
constructor(component: Component, parent:
|
|
21
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
22
22
|
}
|
|
@@ -3,6 +3,10 @@ import Expression from './shared/Expression';
|
|
|
3
3
|
import Component from '../Component';
|
|
4
4
|
import TemplateScope from './shared/TemplateScope';
|
|
5
5
|
import { Node as ESTreeNode } from 'estree';
|
|
6
|
+
import { TemplateNode } from '../../interfaces';
|
|
7
|
+
import Element from './Element';
|
|
8
|
+
import InlineComponent from './InlineComponent';
|
|
9
|
+
import Window from './Window';
|
|
6
10
|
export default class Binding extends Node {
|
|
7
11
|
type: 'Binding';
|
|
8
12
|
name: string;
|
|
@@ -10,6 +14,6 @@ export default class Binding extends Node {
|
|
|
10
14
|
raw_expression: ESTreeNode;
|
|
11
15
|
is_contextual: boolean;
|
|
12
16
|
is_readonly: boolean;
|
|
13
|
-
constructor(component: Component, parent:
|
|
17
|
+
constructor(component: Component, parent: Element | InlineComponent | Window, scope: TemplateScope, info: TemplateNode);
|
|
14
18
|
is_readonly_media_attribute(): boolean;
|
|
15
19
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import EventHandler from './EventHandler';
|
|
3
|
+
import Component from '../Component';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { TemplateNode } from '../../interfaces';
|
|
3
6
|
export default class Body extends Node {
|
|
4
7
|
type: 'Body';
|
|
5
8
|
handlers: EventHandler[];
|
|
6
|
-
constructor(component:
|
|
9
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
7
10
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
|
+
import { TemplateNode } from '../../interfaces';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import Component from '../Component';
|
|
3
6
|
export default class Class extends Node {
|
|
4
7
|
type: 'Class';
|
|
5
8
|
name: string;
|
|
6
9
|
expression: Expression;
|
|
7
|
-
constructor(component:
|
|
10
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
8
11
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { TemplateNode } from '../../interfaces';
|
|
2
|
+
import Component from '../Component';
|
|
1
3
|
import Node from './shared/Node';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
2
5
|
export default class Comment extends Node {
|
|
3
6
|
type: 'Comment';
|
|
4
7
|
data: string;
|
|
5
8
|
ignores: string[];
|
|
6
|
-
constructor(component:
|
|
9
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
7
10
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
|
+
import Component from '../Component';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { TemplateNode } from '../../interfaces';
|
|
6
|
+
import { INode } from './interfaces';
|
|
3
7
|
export default class DebugTag extends Node {
|
|
4
8
|
type: 'DebugTag';
|
|
5
9
|
expressions: Expression[];
|
|
6
|
-
constructor(component:
|
|
10
|
+
constructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode);
|
|
7
11
|
}
|
|
@@ -4,6 +4,8 @@ import TemplateScope from './shared/TemplateScope';
|
|
|
4
4
|
import AbstractBlock from './shared/AbstractBlock';
|
|
5
5
|
import { Context } from './shared/Context';
|
|
6
6
|
import { Node } from 'estree';
|
|
7
|
+
import Component from '../Component';
|
|
8
|
+
import { TemplateNode } from '../../interfaces';
|
|
7
9
|
export default class EachBlock extends AbstractBlock {
|
|
8
10
|
type: 'EachBlock';
|
|
9
11
|
expression: Expression;
|
|
@@ -18,5 +20,5 @@ export default class EachBlock extends AbstractBlock {
|
|
|
18
20
|
has_binding: boolean;
|
|
19
21
|
has_index_binding: boolean;
|
|
20
22
|
else?: ElseBlock;
|
|
21
|
-
constructor(component:
|
|
23
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
22
24
|
}
|
|
@@ -26,7 +26,7 @@ export default class Element extends Node {
|
|
|
26
26
|
children: INode[];
|
|
27
27
|
namespace: string;
|
|
28
28
|
needs_manual_style_scoping: boolean;
|
|
29
|
-
constructor(component: Component, parent:
|
|
29
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: any);
|
|
30
30
|
validate(): void;
|
|
31
31
|
validate_attributes(): void;
|
|
32
32
|
validate_special_cases(): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import AbstractBlock from './shared/AbstractBlock';
|
|
2
2
|
import Component from '../Component';
|
|
3
|
+
import TemplateScope from './shared/TemplateScope';
|
|
4
|
+
import { TemplateNode } from '../../interfaces';
|
|
5
|
+
import Node from './shared/Node';
|
|
3
6
|
export default class ElseBlock extends AbstractBlock {
|
|
4
7
|
type: 'ElseBlock';
|
|
5
|
-
constructor(component: Component, parent:
|
|
8
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
6
9
|
}
|
|
@@ -2,6 +2,8 @@ import Node from './shared/Node';
|
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
3
|
import Component from '../Component';
|
|
4
4
|
import { Identifier } from 'estree';
|
|
5
|
+
import TemplateScope from './shared/TemplateScope';
|
|
6
|
+
import { TemplateNode } from '../../interfaces';
|
|
5
7
|
export default class EventHandler extends Node {
|
|
6
8
|
type: 'EventHandler';
|
|
7
9
|
name: string;
|
|
@@ -10,6 +12,6 @@ export default class EventHandler extends Node {
|
|
|
10
12
|
handler_name: Identifier;
|
|
11
13
|
uses_context: boolean;
|
|
12
14
|
can_make_passive: boolean;
|
|
13
|
-
constructor(component: Component, parent:
|
|
14
|
-
|
|
15
|
+
constructor(component: Component, parent: Node, template_scope: TemplateScope, info: TemplateNode);
|
|
16
|
+
get reassigned(): boolean;
|
|
15
17
|
}
|
|
@@ -3,10 +3,11 @@ import Component from '../Component';
|
|
|
3
3
|
import Block from '../render_dom/Block';
|
|
4
4
|
import TemplateScope from './shared/TemplateScope';
|
|
5
5
|
import { INode } from './interfaces';
|
|
6
|
+
import { TemplateNode } from '../../interfaces';
|
|
6
7
|
export default class Fragment extends Node {
|
|
7
8
|
type: 'Fragment';
|
|
8
9
|
block: Block;
|
|
9
10
|
children: INode[];
|
|
10
11
|
scope: TemplateScope;
|
|
11
|
-
constructor(component: Component, info:
|
|
12
|
+
constructor(component: Component, info: TemplateNode);
|
|
12
13
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
|
+
import Component from '../Component';
|
|
3
|
+
import TemplateScope from './shared/TemplateScope';
|
|
4
|
+
import { TemplateNode } from '../../interfaces';
|
|
2
5
|
export default class Head extends Node {
|
|
3
6
|
type: 'Head';
|
|
4
7
|
children: any[];
|
|
5
8
|
id: string;
|
|
6
|
-
constructor(component:
|
|
9
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
7
10
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import ElseBlock from './ElseBlock';
|
|
2
2
|
import Expression from './shared/Expression';
|
|
3
3
|
import AbstractBlock from './shared/AbstractBlock';
|
|
4
|
+
import Component from '../Component';
|
|
5
|
+
import TemplateScope from './shared/TemplateScope';
|
|
6
|
+
import { TemplateNode } from '../../interfaces';
|
|
7
|
+
import Node from './shared/Node';
|
|
4
8
|
export default class IfBlock extends AbstractBlock {
|
|
5
9
|
type: 'IfBlock';
|
|
6
10
|
expression: Expression;
|
|
7
11
|
else: ElseBlock;
|
|
8
|
-
constructor(component:
|
|
12
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
9
13
|
}
|
|
@@ -7,6 +7,7 @@ import Component from '../Component';
|
|
|
7
7
|
import Let from './Let';
|
|
8
8
|
import TemplateScope from './shared/TemplateScope';
|
|
9
9
|
import { INode } from './interfaces';
|
|
10
|
+
import { TemplateNode } from '../../interfaces';
|
|
10
11
|
export default class InlineComponent extends Node {
|
|
11
12
|
type: 'InlineComponent';
|
|
12
13
|
name: string;
|
|
@@ -17,5 +18,5 @@ export default class InlineComponent extends Node {
|
|
|
17
18
|
lets: Let[];
|
|
18
19
|
children: INode[];
|
|
19
20
|
scope: TemplateScope;
|
|
20
|
-
constructor(component: Component, parent:
|
|
21
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
21
22
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import Expression from './shared/Expression';
|
|
2
2
|
import AbstractBlock from './shared/AbstractBlock';
|
|
3
|
+
import Component from '../Component';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { TemplateNode } from '../../interfaces';
|
|
6
|
+
import Node from './shared/Node';
|
|
3
7
|
export default class KeyBlock extends AbstractBlock {
|
|
4
8
|
type: 'KeyBlock';
|
|
5
9
|
expression: Expression;
|
|
6
|
-
constructor(component:
|
|
10
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
7
11
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Node from './shared/Node';
|
|
2
2
|
import Component from '../Component';
|
|
3
3
|
import { Identifier } from 'estree';
|
|
4
|
+
import TemplateScope from './shared/TemplateScope';
|
|
5
|
+
import { TemplateNode } from '../../interfaces';
|
|
4
6
|
export default class Let extends Node {
|
|
5
7
|
type: 'Let';
|
|
6
8
|
name: Identifier;
|
|
7
9
|
value: Identifier;
|
|
8
10
|
names: string[];
|
|
9
|
-
constructor(component: Component, parent:
|
|
11
|
+
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
|
10
12
|
}
|