svelte 3.46.0 → 3.46.4

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/internal/index.js CHANGED
@@ -1969,7 +1969,7 @@ class SvelteComponent {
1969
1969
  }
1970
1970
 
1971
1971
  function dispatch_dev(type, detail) {
1972
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.46.0' }, detail), true));
1972
+ document.dispatchEvent(custom_event(type, Object.assign({ version: '3.46.4' }, detail), true));
1973
1973
  }
1974
1974
  function append_dev(target, node) {
1975
1975
  dispatch_dev('SvelteDOMInsert', { target, node });
@@ -1967,7 +1967,7 @@ class SvelteComponent {
1967
1967
  }
1968
1968
 
1969
1969
  function dispatch_dev(type, detail) {
1970
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.46.0' }, detail), true));
1970
+ document.dispatchEvent(custom_event(type, Object.assign({ version: '3.46.4' }, detail), true));
1971
1971
  }
1972
1972
  function append_dev(target, node) {
1973
1973
  dispatch_dev('SvelteDOMInsert', { target, node });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte",
3
- "version": "3.46.0",
3
+ "version": "3.46.4",
4
4
  "description": "Cybernetically enhanced web apps",
5
5
  "module": "index.mjs",
6
6
  "main": "index",
@@ -86,10 +86,6 @@
86
86
  "test": "mocha --exit",
87
87
  "test:unit": "mocha --require sucrase/register --recursive src/**/__test__.ts --exit",
88
88
  "quicktest": "mocha",
89
- "precoverage": "c8 mocha",
90
- "coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html",
91
- "codecov": "codecov",
92
- "precodecov": "npm run coverage",
93
89
  "build": "rollup -c && npm run tsd",
94
90
  "prepare": "npm run build",
95
91
  "dev": "rollup -cw",
@@ -131,9 +127,7 @@
131
127
  "@typescript-eslint/parser": "^4.31.2",
132
128
  "acorn": "^8.4.1",
133
129
  "agadoo": "^1.1.0",
134
- "c8": "^5.0.1",
135
- "code-red": "^0.2.4",
136
- "codecov": "^3.5.0",
130
+ "code-red": "^0.2.5",
137
131
  "css-tree": "^1.1.2",
138
132
  "eslint": "^7.32.0",
139
133
  "eslint-plugin-import": "^2.24.2",
@@ -66,8 +66,8 @@ export default class Component {
66
66
  slots: Map<string, Slot>;
67
67
  slot_outlets: Set<string>;
68
68
  constructor(ast: Ast, source: string, name: string, compile_options: CompileOptions, stats: Stats, warnings: Warning[]);
69
- add_var(variable: Var, add_to_lookup?: boolean): void;
70
- add_reference(name: string): void;
69
+ add_var(node: Node, variable: Var, add_to_lookup?: boolean): void;
70
+ add_reference(node: Node, name: string): void;
71
71
  alias(name: string): Identifier;
72
72
  apply_stylesheet(element: Element): void;
73
73
  global(name: string): Identifier;
@@ -6,7 +6,7 @@ import Transition from './Transition';
6
6
  import Animation from './Animation';
7
7
  import Action from './Action';
8
8
  import Class from './Class';
9
- import Style from './Style';
9
+ import StyleDirective from './StyleDirective';
10
10
  import Let from './Let';
11
11
  import TemplateScope from './shared/TemplateScope';
12
12
  import { INode } from './interfaces';
@@ -19,7 +19,7 @@ export default class Element extends Node {
19
19
  actions: Action[];
20
20
  bindings: Binding[];
21
21
  classes: Class[];
22
- styles: Style[];
22
+ styles: StyleDirective[];
23
23
  handlers: EventHandler[];
24
24
  lets: Let[];
25
25
  intro?: Transition;
@@ -0,0 +1,12 @@
1
+ import { TemplateNode } from '../../interfaces';
2
+ import Component from '../Component';
3
+ import Expression from './shared/Expression';
4
+ import Node from './shared/Node';
5
+ import TemplateScope from './shared/TemplateScope';
6
+ export default class StyleDirective extends Node {
7
+ type: 'StyleDirective';
8
+ name: string;
9
+ expression: Expression;
10
+ should_cache: boolean;
11
+ constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
12
+ }
@@ -9,4 +9,6 @@ export default class Text extends Node {
9
9
  synthetic: boolean;
10
10
  constructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode);
11
11
  should_skip(): any;
12
+ keep_space(): boolean;
13
+ within_pre(): boolean;
12
14
  }
@@ -7,7 +7,7 @@ import Binding from './Binding';
7
7
  import Body from './Body';
8
8
  import CatchBlock from './CatchBlock';
9
9
  import Class from './Class';
10
- import Style from './Style';
10
+ import StyleDirective from './StyleDirective';
11
11
  import Comment from './Comment';
12
12
  import ConstTag from './ConstTag';
13
13
  import DebugTag from './DebugTag';
@@ -32,5 +32,5 @@ import ThenBlock from './ThenBlock';
32
32
  import Title from './Title';
33
33
  import Transition from './Transition';
34
34
  import Window from './Window';
35
- export declare type INode = Action | Animation | Attribute | AwaitBlock | Binding | Body | CatchBlock | Class | Comment | ConstTag | DebugTag | EachBlock | Element | ElseBlock | EventHandler | Fragment | Head | IfBlock | InlineComponent | KeyBlock | Let | MustacheTag | Options | PendingBlock | RawMustacheTag | Slot | SlotTemplate | Style | Tag | Text | ThenBlock | Title | Transition | Window;
35
+ export declare type INode = Action | Animation | Attribute | AwaitBlock | Binding | Body | CatchBlock | Class | Comment | ConstTag | DebugTag | EachBlock | Element | ElseBlock | EventHandler | Fragment | Head | IfBlock | InlineComponent | KeyBlock | Let | MustacheTag | Options | PendingBlock | RawMustacheTag | Slot | SlotTemplate | StyleDirective | Tag | Text | ThenBlock | Title | Transition | Window;
36
36
  export declare type INodeAllowConstTag = EachBlock | CatchBlock | ThenBlock | InlineComponent | SlotTemplate;
@@ -0,0 +1,7 @@
1
+ import { TemplateLiteral } from 'estree';
2
+ import { MustacheTag, Text } from '../../interfaces';
3
+ /**
4
+ * Transforms a list of Text and MustacheTags into a TemplateLiteral expression.
5
+ * Start/End positions on the elements of the expression are not set.
6
+ */
7
+ export declare function nodes_to_template_literal(value: Array<Text | MustacheTag>): TemplateLiteral;
@@ -32,8 +32,12 @@ interface DebugTag extends BaseNode {
32
32
  type: 'DebugTag';
33
33
  identifiers: Node[];
34
34
  }
35
- export declare type DirectiveType = 'Action' | 'Animation' | 'Binding' | 'Class' | 'Style' | 'EventHandler' | 'Let' | 'Ref' | 'Transition';
35
+ export declare type DirectiveType = 'Action' | 'Animation' | 'Binding' | 'Class' | 'StyleDirective' | 'EventHandler' | 'Let' | 'Ref' | 'Transition';
36
36
  interface BaseDirective extends BaseNode {
37
+ type: DirectiveType;
38
+ name: string;
39
+ }
40
+ interface BaseExpressionDirective extends BaseDirective {
37
41
  type: DirectiveType;
38
42
  expression: null | Node;
39
43
  name: string;
@@ -53,12 +57,12 @@ export interface SpreadAttribute extends BaseNode {
53
57
  type: 'Spread';
54
58
  expression: Node;
55
59
  }
56
- export interface Transition extends BaseDirective {
60
+ export interface Transition extends BaseExpressionDirective {
57
61
  type: 'Transition';
58
62
  intro: boolean;
59
63
  outro: boolean;
60
64
  }
61
- export declare type Directive = BaseDirective | Transition;
65
+ export declare type Directive = BaseDirective | BaseExpressionDirective | Transition;
62
66
  export declare type TemplateNode = Text | ConstTag | DebugTag | MustacheTag | BaseNode | Element | Attribute | SpreadAttribute | Directive | Transition | Comment;
63
67
  export interface Parser {
64
68
  readonly template: string;
@@ -87,9 +91,9 @@ export interface Style extends BaseNode {
87
91
  }
88
92
  export interface Ast {
89
93
  html: TemplateNode;
90
- css: Style;
91
- instance: Script;
92
- module: Script;
94
+ css?: Style;
95
+ instance?: Script;
96
+ module?: Script;
93
97
  }
94
98
  export interface Warning {
95
99
  start?: {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Pushes all `items` into `array` using `push`, therefore mutating the array.
3
+ * We do this for memory and perf reasons, and because `array.push(...items)` would
4
+ * run into a "max call stack size exceeded" error with too many items (~65k).
5
+ * @param array
6
+ * @param items
7
+ */
8
+ export declare function push_array<T>(array: T[], items: T[]): void;
@@ -5,7 +5,7 @@ export interface AnimationConfig {
5
5
  css?: (t: number, u: number) => string;
6
6
  tick?: (t: number, u: number) => void;
7
7
  }
8
- interface FlipParams {
8
+ export interface FlipParams {
9
9
  delay?: number;
10
10
  duration?: number | ((len: number) => number);
11
11
  easing?: (t: number) => number;
@@ -14,4 +14,3 @@ export declare function flip(node: Element, { from, to }: {
14
14
  from: DOMRect;
15
15
  to: DOMRect;
16
16
  }, params?: FlipParams): AnimationConfig;
17
- export {};