@rindo/core 2.16.1 → 2.17.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.
Files changed (49) hide show
  1. package/cli/config-flags.d.ts +102 -0
  2. package/cli/index.cjs +690 -223
  3. package/cli/index.d.ts +2 -1
  4. package/cli/index.js +690 -223
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/rindo.js +856 -289
  8. package/compiler/rindo.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.js +1 -1
  11. package/dev-server/client/package.json +1 -1
  12. package/dev-server/connector.html +2 -2
  13. package/dev-server/index.js +1 -1
  14. package/dev-server/package.json +1 -1
  15. package/dev-server/server-process.js +2 -2
  16. package/internal/app-data/package.json +1 -1
  17. package/internal/client/css-shim.js +1 -1
  18. package/internal/client/dom.js +1 -1
  19. package/internal/client/index.js +11 -6
  20. package/internal/client/package.json +1 -1
  21. package/internal/client/patch-browser.js +1 -1
  22. package/internal/client/patch-esm.js +1 -1
  23. package/internal/client/shadow-css.js +1 -1
  24. package/internal/hydrate/index.js +2 -2
  25. package/internal/hydrate/package.json +1 -1
  26. package/internal/package.json +1 -1
  27. package/internal/rindo-private.d.ts +6 -2
  28. package/internal/rindo-public-compiler.d.ts +67 -48
  29. package/internal/testing/index.js +1 -1
  30. package/internal/testing/package.json +1 -1
  31. package/mock-doc/index.cjs +140 -5
  32. package/mock-doc/index.d.ts +76 -1
  33. package/mock-doc/index.js +140 -5
  34. package/mock-doc/package.json +1 -1
  35. package/package.json +5 -3
  36. package/screenshot/package.json +1 -1
  37. package/sys/node/index.js +325 -314
  38. package/sys/node/package.json +1 -1
  39. package/sys/node/worker.js +1 -1
  40. package/testing/index.d.ts +1 -1
  41. package/testing/index.js +124 -69
  42. package/testing/jest/jest-config.d.ts +1 -1
  43. package/testing/jest/jest-runner.d.ts +3 -2
  44. package/testing/jest/jest-screenshot.d.ts +1 -1
  45. package/testing/mocks.d.ts +48 -3
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
  48. package/testing/testing-utils.d.ts +74 -2
  49. package/testing/testing.d.ts +2 -2
@@ -1,5 +1,6 @@
1
1
  import type { JsonDocs } from './rindo-public-docs';
2
2
  import type { PrerenderUrlResults } from '../internal';
3
+ import type { ConfigFlags } from '../cli/config-flags';
3
4
  export * from './rindo-public-docs';
4
5
  /**
5
6
  * https://rindojs.web.app/docs/config/
@@ -356,6 +357,29 @@ declare type Loose<T extends Object> = Record<string, any> & Partial<T>;
356
357
  * and have type information carry though as we construct an object which is a valid `Config`.
357
358
  */
358
359
  export declare type UnvalidatedConfig = Loose<Config>;
360
+ /**
361
+ * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
362
+ * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
363
+ *
364
+ * ```typescript
365
+ * type Foo { bar?: number, baz?: string }
366
+ * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
367
+ * ```
368
+ */
369
+ declare type RequireFields<T, K extends keyof T> = T & {
370
+ [P in K]-?: T[P];
371
+ };
372
+ /**
373
+ * Fields in {@link Config} to make required for {@link ValidatedConfig}
374
+ */
375
+ declare type StrictConfigFields = 'flags' | 'logger';
376
+ /**
377
+ * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
378
+ * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
379
+ * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
380
+ * validations have occurred at runtime.
381
+ */
382
+ export declare type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
359
383
  export interface HydratedFlag {
360
384
  /**
361
385
  * Defaults to `hydrated`.
@@ -505,51 +529,6 @@ export interface DevServerEditor {
505
529
  supported?: boolean;
506
530
  priority?: number;
507
531
  }
508
- export interface ConfigFlags {
509
- task?: TaskCommand;
510
- args?: string[];
511
- knownArgs?: string[];
512
- unknownArgs?: string[];
513
- address?: string;
514
- build?: boolean;
515
- cache?: boolean;
516
- checkVersion?: boolean;
517
- ci?: boolean;
518
- compare?: boolean;
519
- config?: string;
520
- debug?: boolean;
521
- dev?: boolean;
522
- docs?: boolean;
523
- docsApi?: string;
524
- docsJson?: string;
525
- e2e?: boolean;
526
- emulate?: string;
527
- es5?: boolean;
528
- esm?: boolean;
529
- headless?: boolean;
530
- help?: boolean;
531
- log?: boolean;
532
- logLevel?: string;
533
- verbose?: boolean;
534
- maxWorkers?: number;
535
- open?: boolean;
536
- port?: number;
537
- prerender?: boolean;
538
- prod?: boolean;
539
- profile?: boolean;
540
- root?: string;
541
- screenshot?: boolean;
542
- screenshotConnector?: string;
543
- serve?: boolean;
544
- serviceWorker?: boolean;
545
- spec?: boolean;
546
- ssr?: boolean;
547
- stats?: boolean;
548
- updateScreenshot?: boolean;
549
- version?: boolean;
550
- watch?: boolean;
551
- devtools?: boolean;
552
- }
553
532
  export declare type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
554
533
  export declare type PageReloadStrategy = 'hmr' | 'pageReload' | null;
555
534
  /**
@@ -1653,7 +1632,29 @@ export interface EmulateViewport {
1653
1632
  */
1654
1633
  isLandscape?: boolean;
1655
1634
  }
1656
- export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | string;
1635
+ /**
1636
+ * This sets the log level hierarchy for our terminal logger, ranging from
1637
+ * most to least verbose.
1638
+ *
1639
+ * Ordering the levels like this lets us easily check whether we should log a
1640
+ * message at a given time. For instance, if the log level is set to `'warn'`,
1641
+ * then anything passed to the logger with level `'warn'` or `'error'` should
1642
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
1643
+ *
1644
+ * If we have a current log level `currentLevel` and a message with level
1645
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
1646
+ * log it by checking if the log level on the message is further up or at the
1647
+ * same level in the hierarchy than `currentLevel`, like so:
1648
+ *
1649
+ * ```ts
1650
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
1651
+ * ```
1652
+ *
1653
+ * NOTE: for the reasons described above, do not change the order of the entries
1654
+ * in this array without good reason!
1655
+ */
1656
+ export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
1657
+ export declare type LogLevel = typeof LOG_LEVELS[number];
1657
1658
  /**
1658
1659
  * Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
1659
1660
  * NodeJS based console logging and colors, and the web will use browser based
@@ -1980,7 +1981,7 @@ export interface LoadConfigInit {
1980
1981
  * operations around the codebase.
1981
1982
  */
1982
1983
  export interface LoadConfigResults {
1983
- config: UnvalidatedConfig;
1984
+ config: ValidatedConfig;
1984
1985
  diagnostics: Diagnostic[];
1985
1986
  tsconfig: {
1986
1987
  path: string;
@@ -2048,14 +2049,32 @@ export interface PrerenderResults {
2048
2049
  duration: number;
2049
2050
  average: number;
2050
2051
  }
2052
+ /**
2053
+ * Input for CSS optimization functions, including the input CSS
2054
+ * string and a few boolean options which turn on or off various
2055
+ * optimizations.
2056
+ */
2051
2057
  export interface OptimizeCssInput {
2052
2058
  input: string;
2053
2059
  filePath?: string;
2054
- autoprefixer?: any;
2060
+ autoprefixer?: boolean | null | AutoprefixerOptions;
2055
2061
  minify?: boolean;
2056
2062
  sourceMap?: boolean;
2057
2063
  resolveUrl?: (url: string) => Promise<string> | string;
2058
2064
  }
2065
+ /**
2066
+ * This is not a real interface describing the options which can
2067
+ * be passed to autoprefixer, for that see the docs, here:
2068
+ * https://github.com/postcss/autoprefixer#options
2069
+ *
2070
+ * Instead, this basically just serves as a label type to track
2071
+ * that arguments are being passed consistently.
2072
+ */
2073
+ export declare type AutoprefixerOptions = Object;
2074
+ /**
2075
+ * Output from CSS optimization functions, wrapping up optimized
2076
+ * CSS and any diagnostics produced during optimization.
2077
+ */
2059
2078
  export interface OptimizeCssOutput {
2060
2079
  output: string;
2061
2080
  diagnostics: Diagnostic[];
@@ -1089,5 +1089,5 @@ exports.setMode = e => modeResolutionChain.push(e), exports.setPlatformHelpers =
1089
1089
  }), 100));
1090
1090
  }));
1091
1091
  }, exports.stopAutoApplyChanges = stopAutoApplyChanges, exports.styles = styles,
1092
- exports.supportsConstructibleStylesheets = !1, exports.supportsListenerOptions = !0,
1092
+ exports.supportsConstructableStylesheets = !1, exports.supportsListenerOptions = !0,
1093
1093
  exports.win = win, exports.writeTask = writeTask;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "2.16.1",
3
+ "version": "2.17.1",
4
4
  "description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc (CommonJS) v2.16.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v2.17.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
@@ -1602,6 +1602,9 @@ class MockElement extends MockNode {
1602
1602
  this.shadowRoot = shadowRoot;
1603
1603
  return shadowRoot;
1604
1604
  }
1605
+ blur() {
1606
+ /**/
1607
+ }
1605
1608
  get shadowRoot() {
1606
1609
  return this.__shadowRoot || null;
1607
1610
  }
@@ -1670,6 +1673,7 @@ class MockElement extends MockNode {
1670
1673
  get firstElementChild() {
1671
1674
  return this.children[0] || null;
1672
1675
  }
1676
+ focus(_options) { }
1673
1677
  getAttribute(attrName) {
1674
1678
  if (attrName === 'style') {
1675
1679
  if (this.__style != null && this.__style.length > 0) {
@@ -2573,7 +2577,28 @@ function createElementNS(ownerDocument, namespaceURI, tagName) {
2573
2577
  return createElement(ownerDocument, tagName);
2574
2578
  }
2575
2579
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
2576
- return new MockSVGElement(ownerDocument, tagName);
2580
+ switch (tagName.toLowerCase()) {
2581
+ case 'text':
2582
+ case 'tspan':
2583
+ case 'tref':
2584
+ case 'altglyph':
2585
+ case 'textpath':
2586
+ return new MockSVGTextContentElement(ownerDocument, tagName);
2587
+ case 'circle':
2588
+ case 'ellipse':
2589
+ case 'image':
2590
+ case 'line':
2591
+ case 'path':
2592
+ case 'polygon':
2593
+ case 'polyline':
2594
+ case 'rect':
2595
+ case 'use':
2596
+ return new MockSVGGraphicsElement(ownerDocument, tagName);
2597
+ case 'svg':
2598
+ return new MockSVGSVGElement(ownerDocument, tagName);
2599
+ default:
2600
+ return new MockSVGElement(ownerDocument, tagName);
2601
+ }
2577
2602
  }
2578
2603
  else {
2579
2604
  return new MockElement(ownerDocument, tagName);
@@ -2720,6 +2745,98 @@ class MockScriptElement extends MockHTMLElement {
2720
2745
  patchPropAttributes(MockScriptElement.prototype, {
2721
2746
  type: String,
2722
2747
  });
2748
+ class MockDOMMatrix {
2749
+ constructor() {
2750
+ this.a = 1;
2751
+ this.b = 0;
2752
+ this.c = 0;
2753
+ this.d = 1;
2754
+ this.e = 0;
2755
+ this.f = 0;
2756
+ this.m11 = 1;
2757
+ this.m12 = 0;
2758
+ this.m13 = 0;
2759
+ this.m14 = 0;
2760
+ this.m21 = 0;
2761
+ this.m22 = 1;
2762
+ this.m23 = 0;
2763
+ this.m24 = 0;
2764
+ this.m31 = 0;
2765
+ this.m32 = 0;
2766
+ this.m33 = 1;
2767
+ this.m34 = 0;
2768
+ this.m41 = 0;
2769
+ this.m42 = 0;
2770
+ this.m43 = 0;
2771
+ this.m44 = 1;
2772
+ this.is2D = true;
2773
+ this.isIdentity = true;
2774
+ }
2775
+ static fromMatrix() {
2776
+ return new MockDOMMatrix();
2777
+ }
2778
+ inverse() {
2779
+ return new MockDOMMatrix();
2780
+ }
2781
+ flipX() {
2782
+ return new MockDOMMatrix();
2783
+ }
2784
+ flipY() {
2785
+ return new MockDOMMatrix();
2786
+ }
2787
+ multiply() {
2788
+ return new MockDOMMatrix();
2789
+ }
2790
+ rotate() {
2791
+ return new MockDOMMatrix();
2792
+ }
2793
+ rotateAxisAngle() {
2794
+ return new MockDOMMatrix();
2795
+ }
2796
+ rotateFromVector() {
2797
+ return new MockDOMMatrix();
2798
+ }
2799
+ scale() {
2800
+ return new MockDOMMatrix();
2801
+ }
2802
+ scaleNonUniform() {
2803
+ return new MockDOMMatrix();
2804
+ }
2805
+ skewX() {
2806
+ return new MockDOMMatrix();
2807
+ }
2808
+ skewY() {
2809
+ return new MockDOMMatrix();
2810
+ }
2811
+ toJSON() { }
2812
+ toString() { }
2813
+ transformPoint() {
2814
+ return new MockDOMPoint();
2815
+ }
2816
+ translate() {
2817
+ return new MockDOMMatrix();
2818
+ }
2819
+ }
2820
+ class MockDOMPoint {
2821
+ constructor() {
2822
+ this.w = 1;
2823
+ this.x = 0;
2824
+ this.y = 0;
2825
+ this.z = 0;
2826
+ }
2827
+ toJSON() { }
2828
+ matrixTransform() {
2829
+ return new MockDOMMatrix();
2830
+ }
2831
+ }
2832
+ class MockSVGRect {
2833
+ constructor() {
2834
+ this.height = 10;
2835
+ this.width = 10;
2836
+ this.x = 0;
2837
+ this.y = 0;
2838
+ }
2839
+ }
2723
2840
  class MockStyleElement extends MockHTMLElement {
2724
2841
  constructor(ownerDocument) {
2725
2842
  super(ownerDocument, 'style');
@@ -2752,9 +2869,6 @@ class MockSVGElement extends MockElement {
2752
2869
  get viewportElement() {
2753
2870
  return null;
2754
2871
  }
2755
- focus() {
2756
- /**/
2757
- }
2758
2872
  onunload() {
2759
2873
  /**/
2760
2874
  }
@@ -2772,6 +2886,27 @@ class MockSVGElement extends MockElement {
2772
2886
  return 0;
2773
2887
  }
2774
2888
  }
2889
+ class MockSVGGraphicsElement extends MockSVGElement {
2890
+ getBBox(_options) {
2891
+ return new MockSVGRect();
2892
+ }
2893
+ getCTM() {
2894
+ return new MockDOMMatrix();
2895
+ }
2896
+ getScreenCTM() {
2897
+ return new MockDOMMatrix();
2898
+ }
2899
+ }
2900
+ class MockSVGSVGElement extends MockSVGGraphicsElement {
2901
+ createSVGPoint() {
2902
+ return new MockDOMPoint();
2903
+ }
2904
+ }
2905
+ class MockSVGTextContentElement extends MockSVGGraphicsElement {
2906
+ getComputedTextLength() {
2907
+ return 0;
2908
+ }
2909
+ }
2775
2910
  class MockBaseElement extends MockHTMLElement {
2776
2911
  constructor(ownerDocument) {
2777
2912
  super(ownerDocument, 'base');
@@ -199,6 +199,62 @@ declare class MockScriptElement extends MockHTMLElement {
199
199
  get src(): string;
200
200
  set src(value: string);
201
201
  }
202
+ declare class MockDOMMatrix {
203
+ static fromMatrix(): MockDOMMatrix;
204
+ a: number;
205
+ b: number;
206
+ c: number;
207
+ d: number;
208
+ e: number;
209
+ f: number;
210
+ m11: number;
211
+ m12: number;
212
+ m13: number;
213
+ m14: number;
214
+ m21: number;
215
+ m22: number;
216
+ m23: number;
217
+ m24: number;
218
+ m31: number;
219
+ m32: number;
220
+ m33: number;
221
+ m34: number;
222
+ m41: number;
223
+ m42: number;
224
+ m43: number;
225
+ m44: number;
226
+ is2D: boolean;
227
+ isIdentity: boolean;
228
+ inverse(): MockDOMMatrix;
229
+ flipX(): MockDOMMatrix;
230
+ flipY(): MockDOMMatrix;
231
+ multiply(): MockDOMMatrix;
232
+ rotate(): MockDOMMatrix;
233
+ rotateAxisAngle(): MockDOMMatrix;
234
+ rotateFromVector(): MockDOMMatrix;
235
+ scale(): MockDOMMatrix;
236
+ scaleNonUniform(): MockDOMMatrix;
237
+ skewX(): MockDOMMatrix;
238
+ skewY(): MockDOMMatrix;
239
+ toJSON(): void;
240
+ toString(): void;
241
+ transformPoint(): MockDOMPoint;
242
+ translate(): MockDOMMatrix;
243
+ }
244
+ declare class MockDOMPoint {
245
+ w: number;
246
+ x: number;
247
+ y: number;
248
+ z: number;
249
+ toJSON(): void;
250
+ matrixTransform(): MockDOMMatrix;
251
+ }
252
+ declare class MockSVGRect {
253
+ height: number;
254
+ width: number;
255
+ x: number;
256
+ y: number;
257
+ }
202
258
  declare class MockStyleElement extends MockHTMLElement {
203
259
  sheet: MockCSSStyleSheet;
204
260
  constructor(ownerDocument: any);
@@ -212,13 +268,28 @@ declare class MockStyleElement extends MockHTMLElement {
212
268
  declare class MockSVGElement extends MockElement {
213
269
  get ownerSVGElement(): SVGSVGElement;
214
270
  get viewportElement(): SVGElement;
215
- focus(): void;
216
271
  onunload(): void;
217
272
  get pathLength(): number;
218
273
  isPointInFill(_pt: DOMPoint): boolean;
219
274
  isPointInStroke(_pt: DOMPoint): boolean;
220
275
  getTotalLength(): number;
221
276
  }
277
+ declare class MockSVGGraphicsElement extends MockSVGElement {
278
+ getBBox(_options?: {
279
+ clipped: boolean;
280
+ fill: boolean;
281
+ markers: boolean;
282
+ stroke: boolean;
283
+ }): MockSVGRect;
284
+ getCTM(): MockDOMMatrix;
285
+ getScreenCTM(): MockDOMMatrix;
286
+ }
287
+ declare class MockSVGSVGElement extends MockSVGGraphicsElement {
288
+ createSVGPoint(): MockDOMPoint;
289
+ }
290
+ declare class MockSVGTextContentElement extends MockSVGGraphicsElement {
291
+ getComputedTextLength(): number;
292
+ }
222
293
  declare class MockBaseElement extends MockHTMLElement {
223
294
  constructor(ownerDocument: any);
224
295
  get href(): string;
@@ -438,6 +509,7 @@ declare class MockElement extends MockNode {
438
509
  constructor(ownerDocument: any, nodeName: string);
439
510
  addEventListener(type: string, handler: (ev?: any) => void): void;
440
511
  attachShadow(_opts: ShadowRootInit): any;
512
+ blur(): void;
441
513
  get shadowRoot(): any;
442
514
  set shadowRoot(shadowRoot: any);
443
515
  get attributes(): MockAttributeMap;
@@ -455,6 +527,9 @@ declare class MockElement extends MockNode {
455
527
  set dir(value: string);
456
528
  dispatchEvent(ev: MockEvent): boolean;
457
529
  get firstElementChild(): MockElement | null;
530
+ focus(_options?: {
531
+ preventScroll?: boolean;
532
+ }): void;
458
533
  getAttribute(attrName: string): any;
459
534
  getAttributeNS(namespaceURI: string, attrName: string): string;
460
535
  getBoundingClientRect(): {
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc v2.16.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v2.17.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -1599,6 +1599,9 @@ class MockElement extends MockNode {
1599
1599
  this.shadowRoot = shadowRoot;
1600
1600
  return shadowRoot;
1601
1601
  }
1602
+ blur() {
1603
+ /**/
1604
+ }
1602
1605
  get shadowRoot() {
1603
1606
  return this.__shadowRoot || null;
1604
1607
  }
@@ -1667,6 +1670,7 @@ class MockElement extends MockNode {
1667
1670
  get firstElementChild() {
1668
1671
  return this.children[0] || null;
1669
1672
  }
1673
+ focus(_options) { }
1670
1674
  getAttribute(attrName) {
1671
1675
  if (attrName === 'style') {
1672
1676
  if (this.__style != null && this.__style.length > 0) {
@@ -2570,7 +2574,28 @@ function createElementNS(ownerDocument, namespaceURI, tagName) {
2570
2574
  return createElement(ownerDocument, tagName);
2571
2575
  }
2572
2576
  else if (namespaceURI === 'http://www.w3.org/2000/svg') {
2573
- return new MockSVGElement(ownerDocument, tagName);
2577
+ switch (tagName.toLowerCase()) {
2578
+ case 'text':
2579
+ case 'tspan':
2580
+ case 'tref':
2581
+ case 'altglyph':
2582
+ case 'textpath':
2583
+ return new MockSVGTextContentElement(ownerDocument, tagName);
2584
+ case 'circle':
2585
+ case 'ellipse':
2586
+ case 'image':
2587
+ case 'line':
2588
+ case 'path':
2589
+ case 'polygon':
2590
+ case 'polyline':
2591
+ case 'rect':
2592
+ case 'use':
2593
+ return new MockSVGGraphicsElement(ownerDocument, tagName);
2594
+ case 'svg':
2595
+ return new MockSVGSVGElement(ownerDocument, tagName);
2596
+ default:
2597
+ return new MockSVGElement(ownerDocument, tagName);
2598
+ }
2574
2599
  }
2575
2600
  else {
2576
2601
  return new MockElement(ownerDocument, tagName);
@@ -2717,6 +2742,98 @@ class MockScriptElement extends MockHTMLElement {
2717
2742
  patchPropAttributes(MockScriptElement.prototype, {
2718
2743
  type: String,
2719
2744
  });
2745
+ class MockDOMMatrix {
2746
+ constructor() {
2747
+ this.a = 1;
2748
+ this.b = 0;
2749
+ this.c = 0;
2750
+ this.d = 1;
2751
+ this.e = 0;
2752
+ this.f = 0;
2753
+ this.m11 = 1;
2754
+ this.m12 = 0;
2755
+ this.m13 = 0;
2756
+ this.m14 = 0;
2757
+ this.m21 = 0;
2758
+ this.m22 = 1;
2759
+ this.m23 = 0;
2760
+ this.m24 = 0;
2761
+ this.m31 = 0;
2762
+ this.m32 = 0;
2763
+ this.m33 = 1;
2764
+ this.m34 = 0;
2765
+ this.m41 = 0;
2766
+ this.m42 = 0;
2767
+ this.m43 = 0;
2768
+ this.m44 = 1;
2769
+ this.is2D = true;
2770
+ this.isIdentity = true;
2771
+ }
2772
+ static fromMatrix() {
2773
+ return new MockDOMMatrix();
2774
+ }
2775
+ inverse() {
2776
+ return new MockDOMMatrix();
2777
+ }
2778
+ flipX() {
2779
+ return new MockDOMMatrix();
2780
+ }
2781
+ flipY() {
2782
+ return new MockDOMMatrix();
2783
+ }
2784
+ multiply() {
2785
+ return new MockDOMMatrix();
2786
+ }
2787
+ rotate() {
2788
+ return new MockDOMMatrix();
2789
+ }
2790
+ rotateAxisAngle() {
2791
+ return new MockDOMMatrix();
2792
+ }
2793
+ rotateFromVector() {
2794
+ return new MockDOMMatrix();
2795
+ }
2796
+ scale() {
2797
+ return new MockDOMMatrix();
2798
+ }
2799
+ scaleNonUniform() {
2800
+ return new MockDOMMatrix();
2801
+ }
2802
+ skewX() {
2803
+ return new MockDOMMatrix();
2804
+ }
2805
+ skewY() {
2806
+ return new MockDOMMatrix();
2807
+ }
2808
+ toJSON() { }
2809
+ toString() { }
2810
+ transformPoint() {
2811
+ return new MockDOMPoint();
2812
+ }
2813
+ translate() {
2814
+ return new MockDOMMatrix();
2815
+ }
2816
+ }
2817
+ class MockDOMPoint {
2818
+ constructor() {
2819
+ this.w = 1;
2820
+ this.x = 0;
2821
+ this.y = 0;
2822
+ this.z = 0;
2823
+ }
2824
+ toJSON() { }
2825
+ matrixTransform() {
2826
+ return new MockDOMMatrix();
2827
+ }
2828
+ }
2829
+ class MockSVGRect {
2830
+ constructor() {
2831
+ this.height = 10;
2832
+ this.width = 10;
2833
+ this.x = 0;
2834
+ this.y = 0;
2835
+ }
2836
+ }
2720
2837
  class MockStyleElement extends MockHTMLElement {
2721
2838
  constructor(ownerDocument) {
2722
2839
  super(ownerDocument, 'style');
@@ -2749,9 +2866,6 @@ class MockSVGElement extends MockElement {
2749
2866
  get viewportElement() {
2750
2867
  return null;
2751
2868
  }
2752
- focus() {
2753
- /**/
2754
- }
2755
2869
  onunload() {
2756
2870
  /**/
2757
2871
  }
@@ -2769,6 +2883,27 @@ class MockSVGElement extends MockElement {
2769
2883
  return 0;
2770
2884
  }
2771
2885
  }
2886
+ class MockSVGGraphicsElement extends MockSVGElement {
2887
+ getBBox(_options) {
2888
+ return new MockSVGRect();
2889
+ }
2890
+ getCTM() {
2891
+ return new MockDOMMatrix();
2892
+ }
2893
+ getScreenCTM() {
2894
+ return new MockDOMMatrix();
2895
+ }
2896
+ }
2897
+ class MockSVGSVGElement extends MockSVGGraphicsElement {
2898
+ createSVGPoint() {
2899
+ return new MockDOMPoint();
2900
+ }
2901
+ }
2902
+ class MockSVGTextContentElement extends MockSVGGraphicsElement {
2903
+ getComputedTextLength() {
2904
+ return 0;
2905
+ }
2906
+ }
2772
2907
  class MockBaseElement extends MockHTMLElement {
2773
2908
  constructor(ownerDocument) {
2774
2909
  super(ownerDocument, 'base');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "2.16.1",
3
+ "version": "2.17.1",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core",
3
- "version": "2.16.1",
3
+ "version": "2.17.1",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -26,8 +26,8 @@
26
26
  "scripts": {
27
27
  "build": "node scripts --prepare && npm run tsc.prod && npm run rollup.prod.ci",
28
28
  "changelog": "conventional-changelog -p angular -o -i CHANGELOG.md -s",
29
- "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean-scripts",
30
- "clean-scripts": "rm -rf scripts/build",
29
+ "clean": "rimraf build cli compiler dev-server internal mock-doc sys testing && npm run clean-scripts",
30
+ "clean-scripts": "rimraf scripts/build",
31
31
  "license": "node scripts --license",
32
32
  "lint": "eslint \"src/*.ts\" \"src/**/*.ts\"",
33
33
  "prettier": "npm run prettier.base -- --write",
@@ -87,6 +87,7 @@
87
87
  "dts-bundle-generator": "~5.3.0",
88
88
  "eslint": "^8.13.0",
89
89
  "eslint-config-prettier": "^8.5.0",
90
+ "eslint-plugin-jest": "^26.5.3",
90
91
  "eslint-plugin-jsdoc": "^39.3.1",
91
92
  "execa": "4.1.0",
92
93
  "exit": "^0.1.2",
@@ -116,6 +117,7 @@
116
117
  "puppeteer": "~10.0.0",
117
118
  "rollup": "2.42.3",
118
119
  "rollup-plugin-sourcemaps": "^0.6.3",
120
+ "rimraf": "^3.0.2",
119
121
  "semver": "7.3.4",
120
122
  "sizzle": "^2.3.6",
121
123
  "terser": "5.6.1",