@teleporthq/teleport-plugin-html-base-component 0.35.0-alpha.0 → 0.35.0

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"}
@@ -5,7 +5,7 @@ interface HtmlPluginConfig {
5
5
  }
6
6
  interface HtmlPlugin {
7
7
  htmlComponentPlugin: ComponentPlugin;
8
- addExternals: (list: Record<string, ComponentUIDL>) => void;
8
+ addExternals: (list: Record<string, ComponentUIDL>, plugins: ComponentPlugin[]) => void;
9
9
  }
10
10
  type HtmlPluginFactory<T> = (config?: Partial<T & ComponentDefaultPluginParams>) => HtmlPlugin;
11
11
  export declare const createHTMLBasePlugin: HtmlPluginFactory<HtmlPluginConfig>;
@@ -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,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,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,EAGd,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,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,CA2FpE,CAAA;;AAED,wBAAqC"}
package/dist/cjs/index.js CHANGED
@@ -56,29 +56,53 @@ var teleport_shared_1 = require("@teleporthq/teleport-shared");
56
56
  var createHTMLBasePlugin = function (config) {
57
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;
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, nodesLookup, compBase, subComponents, templateOptions, _i, _d, propKey, prop, bodyContent;
67
+ return __generator(this, function (_e) {
68
+ switch (_e.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
+ 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) {
76
+ subComponents = {
77
+ externals: Object.values(externals).reduce(function (acc, comp) {
74
78
  teleport_shared_1.UIDLUtils.setFriendlyOutputOptions(comp);
75
79
  comp.name = teleport_shared_1.StringUtils.removeIllegalCharacters(comp.name) || 'AppComponent';
76
80
  comp.name = teleport_shared_1.UIDLUtils.getComponentClassName(comp);
77
81
  acc[comp.name] = comp;
78
82
  return acc;
79
- }, {}), options.projectRouteDefinition, { chunks: chunks, dependencies: dependencies, options: options })];
83
+ }, {}),
84
+ plugins: plugins,
85
+ };
86
+ templateOptions = { chunks: chunks, dependencies: dependencies, options: options, outputOptions: outputOptions };
87
+ _i = 0, _d = Object.keys(propDefinitions);
88
+ _e.label = 1;
80
89
  case 1:
81
- bodyContent = _c.sent();
90
+ if (!(_i < _d.length)) return [3 /*break*/, 4];
91
+ propKey = _d[_i];
92
+ prop = propDefinitions[propKey];
93
+ if (!(prop.type === 'element' &&
94
+ prop.defaultValue !== undefined &&
95
+ typeof prop.defaultValue === 'object')) return [3 /*break*/, 3];
96
+ return [4 /*yield*/, (0, node_handlers_1.generateHtmlSyntax)(prop.defaultValue, nodesLookup, propDefinitions, stateDefinitions, subComponents, templateOptions)];
97
+ case 2:
98
+ _e.sent();
99
+ _e.label = 3;
100
+ case 3:
101
+ _i++;
102
+ return [3 /*break*/, 1];
103
+ case 4: return [4 /*yield*/, (0, node_handlers_1.generateHtmlSyntax)(uidl.node, nodesLookup, propDefinitions, stateDefinitions, subComponents, templateOptions)];
104
+ case 5:
105
+ bodyContent = _e.sent();
82
106
  teleport_plugin_common_1.HASTUtils.addChildNode(compBase, bodyContent);
83
107
  chunks.push({
84
108
  type: teleport_types_1.ChunkType.HAST,
@@ -87,7 +111,7 @@ var createHTMLBasePlugin = function (config) {
87
111
  content: compBase,
88
112
  linkAfter: [],
89
113
  meta: {
90
- nodesLookup: templatesLookUp,
114
+ nodesLookup: nodesLookup,
91
115
  },
92
116
  });
93
117
  return [2 /*return*/, structure];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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AAS,EAAA;;;SACjB,CAAA;IAED,OAAO;QACL,mBAAmB,qBAAA;QACnB,YAAY,cAAA;KACb,CAAA;AACH,CAAC,CAAA;AA3FY,QAAA,oBAAoB,wBA2FhC;AAED,kBAAe,IAAA,4BAAoB,GAAE,CAAA"}
@@ -1,9 +1,13 @@
1
- import { UIDLNode, HastNode, UIDLPropDefinition, UIDLStateDefinition, HastText, ComponentUIDL, ChunkDefinition, UIDLDependency, GeneratorOptions, UIDLRouteDefinitions } from '@teleporthq/teleport-types';
2
- 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, nodesLookup: Record<string, HastNode | HastText>, 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
- export declare const generateHtmlSynatx: NodeToHTML<UIDLNode, Promise<HastNode | HastText>>;
11
+ export declare const generateHtmlSyntax: NodeToHTML<UIDLNode, Promise<HastNode | HastText>>;
8
12
  export {};
9
13
  //# sourceMappingURL=node-handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-handlers.d.ts","sourceRoot":"","sources":["../../src/node-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,Q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