@teleporthq/teleport-plugin-html-base-component 0.33.0-alpha.0 → 0.33.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.
@@ -8,27 +8,30 @@ import {
8
8
  import { component, dynamicNode, elementNode, staticNode } from '@teleporthq/teleport-uidl-builders'
9
9
  import { createHTMLBasePlugin } from '../src'
10
10
 
11
- describe('plugin-html-base-component', () => {
12
- const { htmlComponentPlugin } = createHTMLBasePlugin()
13
- const structure: ComponentStructure = {
14
- chunks: [],
15
- options: {},
16
- uidl: component('Test', elementNode('container')),
17
- dependencies: {},
18
- }
11
+ const getMockComponentStructure = (): ComponentStructure => ({
12
+ chunks: [],
13
+ options: {
14
+ extractedResources: {},
15
+ },
16
+ uidl: component('Test', elementNode('container')),
17
+ dependencies: {},
18
+ })
19
19
 
20
+ describe('plugin-html-base-component', () => {
20
21
  it('generated HAST nodes with the UIDL that is passed', async () => {
21
- const { chunks } = await htmlComponentPlugin(structure)
22
+ const { htmlComponentPlugin } = createHTMLBasePlugin()
23
+ const { chunks } = await htmlComponentPlugin(getMockComponentStructure())
22
24
  const htmlChunk = chunks.find((chunk) => chunk.fileType === FileType.HTML)
23
25
 
24
26
  expect(chunks.length).toBe(1)
25
27
  expect(htmlChunk).toBeDefined()
26
- expect(htmlChunk.name).toBe('html-template')
28
+ expect(htmlChunk?.name).toBe('html-chunk')
27
29
  })
28
30
 
29
31
  it('adds attributes to the HAST node', async () => {
32
+ const { htmlComponentPlugin } = createHTMLBasePlugin()
30
33
  const { chunks } = await htmlComponentPlugin({
31
- ...structure,
34
+ ...getMockComponentStructure(),
32
35
  uidl: component(
33
36
  'Test',
34
37
  elementNode('a', { href: staticNode('/about'), target: staticNode('_blank') }, [
@@ -37,25 +40,27 @@ describe('plugin-html-base-component', () => {
37
40
  ),
38
41
  })
39
42
 
40
- expect(chunks.length).toEqual(2)
41
- expect(((chunks[1].content as HastNode).children[0] as HastNode).properties.href).toBe(
43
+ expect(chunks.length).toEqual(1)
44
+ expect(((chunks[0].content as HastNode).children[0] as HastNode).properties.href).toBe(
42
45
  'about.html'
43
46
  )
44
47
  })
45
48
 
46
49
  it('wraps static content inside div tags', async () => {
50
+ const { htmlComponentPlugin } = createHTMLBasePlugin()
47
51
  const { chunks } = await htmlComponentPlugin({
48
- ...structure,
52
+ ...getMockComponentStructure(),
49
53
  uidl: component('Test', staticNode('Hello') as unknown as UIDLElementNode),
50
54
  })
51
55
 
52
- expect(chunks.length).toEqual(3)
53
- expect((chunks[2].content as HastNode).children.length).toEqual(1)
56
+ expect(chunks.length).toEqual(1)
57
+ expect((chunks[0].content as HastNode).children.length).toEqual(1)
54
58
  })
55
59
 
56
60
  it('Throws error when a external comp is missing', async () => {
61
+ const { htmlComponentPlugin } = createHTMLBasePlugin()
57
62
  const plugin = htmlComponentPlugin({
58
- ...structure,
63
+ ...getMockComponentStructure(),
59
64
  uidl: component('Test', elementNode('Sample', {}, [], { type: 'local' })),
60
65
  })
61
66
 
@@ -63,18 +68,19 @@ describe('plugin-html-base-component', () => {
63
68
  })
64
69
 
65
70
  it('Takes default value from props and state, when nodes are using dynamic ref', async () => {
71
+ const { htmlComponentPlugin } = createHTMLBasePlugin()
66
72
  const { chunks } = await htmlComponentPlugin({
67
- ...structure,
73
+ ...getMockComponentStructure(),
68
74
  uidl: component('Test', elementNode('container', {}, [dynamicNode('prop', 'content')]), {
69
75
  content: { type: 'string', defaultValue: 'Hello World' },
70
76
  }),
71
77
  })
72
78
 
73
79
  const hastText = (
74
- ((chunks[3].content as HastNode).children[0] as HastNode).children[0] as HastNode
80
+ ((chunks[0].content as HastNode).children[0] as HastNode).children[0] as HastNode
75
81
  ).children[0] as HastText
76
82
 
77
- expect(chunks.length).toEqual(4)
83
+ expect(chunks.length).toEqual(1)
78
84
  expect(hastText).toBeDefined()
79
85
  expect(hastText.type).toBe('text')
80
86
  expect(hastText.value).toBe('Hello World')
@@ -1,2 +1,2 @@
1
- export declare const DEFAULT_COMPONENT_CHUNK_NAME = "html-template";
1
+ export declare const DEFAULT_COMPONENT_CHUNK_NAME = "html-chunk";
2
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,kBAAkB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,eAAe,CAAA"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_COMPONENT_CHUNK_NAME = void 0;
4
- exports.DEFAULT_COMPONENT_CHUNK_NAME = 'html-template';
4
+ exports.DEFAULT_COMPONENT_CHUNK_NAME = 'html-chunk';
5
5
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,eAAe,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,YAAY,CAAA"}
@@ -1,13 +1,14 @@
1
- import { ComponentPlugin, ComponentDefaultPluginParams, ComponentUIDL } from '@teleporthq/teleport-types';
1
+ import { ComponentPlugin, ComponentDefaultPluginParams, ComponentUIDL, ElementsLookup } from '@teleporthq/teleport-types';
2
2
  interface HtmlPluginConfig {
3
3
  componentChunkName: string;
4
+ nodesLookup: ElementsLookup;
4
5
  wrapComponent?: boolean;
5
6
  }
6
7
  interface HtmlPlugin {
7
8
  htmlComponentPlugin: ComponentPlugin;
8
- addExternals: (list: Record<string, ComponentUIDL>) => void;
9
+ addExternals: (list: Record<string, ComponentUIDL>, plugins: ComponentPlugin[]) => void;
9
10
  }
10
- declare type HtmlPluginFactory<T> = (config?: Partial<T & ComponentDefaultPluginParams>) => HtmlPlugin;
11
+ type HtmlPluginFactory<T> = (config?: Partial<T & ComponentDefaultPluginParams>) => HtmlPlugin;
11
12
  export declare const createHTMLBasePlugin: HtmlPluginFactory<HtmlPluginConfig>;
12
13
  declare const _default: HtmlPlugin;
13
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIf,4BAA4B,EAC5B,aAAa,EACd,MAAM,4BAA4B,CAAA;AAMnC,UAAU,gBAAgB;IACxB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,UAAU,UAAU;IAClB,mBAAmB,EAAE,eAAe,CAAA;IACpC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,IAAI,CAAA;CAC5D;AAED,aAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,4BAA4B,CAAC,KAAK,UAAU,CAAA;AAE9F,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,gBAAgB,CAuDpE,CAAA;;AAED,wBAAqC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIf,4BAA4B,EAC5B,aAAa,EACb,cAAc,EACf,MAAM,4BAA4B,CAAA;AAMnC,UAAU,gBAAgB;IACxB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,WAAW,EAAE,cAAc,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,UAAU,UAAU;IAClB,mBAAmB,EAAE,eAAe,CAAA;IACpC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAA;CACxF;AAED,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,4BAA4B,CAAC,KAAK,UAAU,CAAA;AAE9F,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,gBAAgB,CAsEpE,CAAA;;AAED,wBAAqC"}
package/dist/cjs/index.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -54,31 +54,37 @@ var constants_1 = require("./constants");
54
54
  var node_handlers_1 = require("./node-handlers");
55
55
  var teleport_shared_1 = require("@teleporthq/teleport-shared");
56
56
  var createHTMLBasePlugin = function (config) {
57
- var _a = config || {}, _b = _a.componentChunkName, componentChunkName = _b === void 0 ? constants_1.DEFAULT_COMPONENT_CHUNK_NAME : _b, _c = _a.wrapComponent, wrapComponent = _c === void 0 ? false : _c;
57
+ var _a = config || {}, _b = _a.componentChunkName, componentChunkName = _b === void 0 ? constants_1.DEFAULT_COMPONENT_CHUNK_NAME : _b, _c = _a.wrapComponent, wrapComponent = _c === void 0 ? false : _c, _d = _a.nodesLookup, nodesLookup = _d === void 0 ? {} : _d;
58
58
  var externals = {};
59
- var addExternals = function (list) {
59
+ var plugins = [];
60
+ var addExternals = function (list, subComponentPlugins) {
61
+ if (subComponentPlugins === void 0) { subComponentPlugins = []; }
60
62
  externals = __assign(__assign({}, externals), (list || {}));
63
+ plugins = subComponentPlugins;
61
64
  };
62
65
  var htmlComponentPlugin = function (structure) { return __awaiter(void 0, void 0, void 0, function () {
63
- var uidl, chunks, dependencies, options, _a, propDefinitions, _b, stateDefinitions, templatesLookUp, compBase, bodyContent;
64
- return __generator(this, function (_c) {
65
- switch (_c.label) {
66
+ var uidl, _a, chunks, dependencies, options, _b, propDefinitions, _c, stateDefinitions, outputOptions, templatesLookUp, compBase, bodyContent;
67
+ return __generator(this, function (_d) {
68
+ switch (_d.label) {
66
69
  case 0:
67
- uidl = structure.uidl, chunks = structure.chunks, dependencies = structure.dependencies, options = structure.options;
68
- _a = uidl.propDefinitions, propDefinitions = _a === void 0 ? {} : _a, _b = uidl.stateDefinitions, stateDefinitions = _b === void 0 ? {} : _b;
69
- templatesLookUp = {};
70
+ uidl = structure.uidl, _a = structure.chunks, chunks = _a === void 0 ? [] : _a, dependencies = structure.dependencies, options = structure.options;
71
+ _b = uidl.propDefinitions, propDefinitions = _b === void 0 ? {} : _b, _c = uidl.stateDefinitions, stateDefinitions = _c === void 0 ? {} : _c, outputOptions = uidl.outputOptions;
72
+ templatesLookUp = __assign({}, nodesLookup);
70
73
  compBase = wrapComponent
71
74
  ? teleport_plugin_common_1.HASTBuilders.createHTMLNode('body')
72
75
  : teleport_plugin_common_1.HASTBuilders.createHTMLNode('div');
73
- return [4 /*yield*/, (0, node_handlers_1.generateHtmlSynatx)(uidl.node, templatesLookUp, propDefinitions, stateDefinitions, Object.values(externals).reduce(function (acc, comp) {
74
- teleport_shared_1.UIDLUtils.setFriendlyOutputOptions(comp);
75
- comp.name = teleport_shared_1.StringUtils.removeIllegalCharacters(comp.name) || 'AppComponent';
76
- comp.name = teleport_shared_1.UIDLUtils.getComponentClassName(comp);
77
- acc[comp.name] = comp;
78
- return acc;
79
- }, {}), options.projectRouteDefinition, { chunks: chunks, dependencies: dependencies, options: options })];
76
+ return [4 /*yield*/, (0, node_handlers_1.generateHtmlSynatx)(uidl.node, templatesLookUp, propDefinitions, stateDefinitions, {
77
+ externals: Object.values(externals).reduce(function (acc, comp) {
78
+ teleport_shared_1.UIDLUtils.setFriendlyOutputOptions(comp);
79
+ comp.name = teleport_shared_1.StringUtils.removeIllegalCharacters(comp.name) || 'AppComponent';
80
+ comp.name = teleport_shared_1.UIDLUtils.getComponentClassName(comp);
81
+ acc[comp.name] = comp;
82
+ return acc;
83
+ }, {}),
84
+ plugins: plugins,
85
+ }, { chunks: chunks, dependencies: dependencies, options: options, outputOptions: outputOptions })];
80
86
  case 1:
81
- bodyContent = _c.sent();
87
+ bodyContent = _d.sent();
82
88
  teleport_plugin_common_1.HASTUtils.addChildNode(compBase, bodyContent);
83
89
  chunks.push({
84
90
  type: teleport_types_1.ChunkType.HAST,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAOmC;AACnC,6EAA4E;AAC5E,yCAA0D;AAC1D,iDAAoD;AACpD,+DAAoE;AAc7D,IAAM,oBAAoB,GAAwC,UAAC,MAAM;IACxE,IAAA,KAA+E,MAAM,IAAI,EAAE,EAAzF,0BAAiD,EAAjD,kBAAkB,mBAAG,wCAA4B,KAAA,EAAE,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAiB,CAAA;IACjG,IAAI,SAAS,GAAkC,EAAE,CAAA;IAEjD,IAAM,YAAY,GAAG,UAAC,IAAoC;QACxD,SAAS,yBACJ,SAAS,GACT,CAAC,IAAI,IAAI,EAAE,CAAC,CAChB,CAAA;IACH,CAAC,CAAA;IAED,IAAM,mBAAmB,GAAoB,UAAO,SAAS;;;;;oBACnD,IAAI,GAAoC,SAAS,KAA7C,EAAE,MAAM,GAA4B,SAAS,OAArC,EAAE,YAAY,GAAc,SAAS,aAAvB,EAAE,OAAO,GAAK,SAAS,QAAd,CAAc;oBACjD,KAAgD,IAAI,gBAAhC,EAApB,eAAe,mBAAG,EAAE,KAAA,EAAE,KAA0B,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;;SACjB,CAAA;IAED,OAAO;QACL,mBAAmB,qBAAA;QACnB,YAAY,cAAA;KACb,CAAA;AACH,CAAC,CAAA;AAtEY,QAAA,oBAAoB,wBAsEhC;AAED,kBAAe,IAAA,4BAAoB,GAAE,CAAA"}
@@ -1,8 +1,12 @@
1
- import { UIDLNode, HastNode, UIDLPropDefinition, UIDLStateDefinition, HastText, ComponentUIDL, ChunkDefinition, UIDLDependency, GeneratorOptions, UIDLRouteDefinitions } from '@teleporthq/teleport-types';
2
- declare type NodeToHTML<NodeType, ReturnType> = (node: NodeType, templatesLookUp: Record<string, unknown>, propDefinitions: Record<string, UIDLPropDefinition>, stateDefinitions: Record<string, UIDLStateDefinition>, externals: Record<string, ComponentUIDL>, routeDefinitions: UIDLRouteDefinitions, structure: {
1
+ import { UIDLNode, HastNode, UIDLPropDefinition, UIDLStateDefinition, HastText, ComponentUIDL, ChunkDefinition, UIDLDependency, GeneratorOptions, ComponentPlugin, UIDLComponentOutputOptions } from '@teleporthq/teleport-types';
2
+ type NodeToHTML<NodeType, ReturnType> = (node: NodeType, templatesLookUp: Record<string, unknown>, propDefinitions: Record<string, UIDLPropDefinition>, stateDefinitions: Record<string, UIDLStateDefinition>, subComponentOptions: {
3
+ externals: Record<string, ComponentUIDL>;
4
+ plugins: ComponentPlugin[];
5
+ }, structure: {
3
6
  chunks: ChunkDefinition[];
4
7
  dependencies: Record<string, UIDLDependency>;
5
8
  options: GeneratorOptions;
9
+ outputOptions: UIDLComponentOutputOptions;
6
10
  }) => ReturnType;
7
11
  export declare const generateHtmlSynatx: NodeToHTML<UIDLNode, Promise<HastNode | HastText>>;
8
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"node-handlers.d.ts","sourceRoot":"","sources":["../../src/node-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,QAAQ,EAGR,kBAAkB,EAClB,mBAAmB,EAGnB,QAAQ,EACR,aAAa,EAGb,eAAe,EACf,cAAc,EAEd,gBAA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