@onivoro/server-html 0.1.1 → 24.24.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.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +281 -0
  3. package/package.json +25 -39
  4. package/{dist/cjs → src}/index.d.ts +2 -0
  5. package/src/index.js +25 -0
  6. package/src/index.js.map +1 -0
  7. package/{dist/esm → src}/lib/deprecated/a.function.d.ts +1 -0
  8. package/{dist/esm → src}/lib/deprecated/a.function.js +2 -2
  9. package/src/lib/deprecated/a.function.js.map +1 -0
  10. package/{dist/cjs → src}/lib/deprecated/html-element-renderer.type.d.ts +1 -0
  11. package/{dist/esm → src}/lib/deprecated/html-element-renderer.type.js +1 -0
  12. package/src/lib/deprecated/html-element-renderer.type.js.map +1 -0
  13. package/{dist/cjs → src}/lib/deprecated/html.function.d.ts +1 -0
  14. package/{dist/cjs → src}/lib/deprecated/html.function.js +2 -2
  15. package/src/lib/deprecated/html.function.js.map +1 -0
  16. package/{dist/cjs → src}/lib/deprecated/login-button.function.d.ts +1 -0
  17. package/{dist/cjs → src}/lib/deprecated/login-button.function.js +2 -2
  18. package/src/lib/deprecated/login-button.function.js.map +1 -0
  19. package/{dist/cjs → src}/lib/deprecated/self-closing-html-element-renderer.type.d.ts +1 -0
  20. package/{dist/esm → src}/lib/deprecated/self-closing-html-element-renderer.type.js +1 -0
  21. package/src/lib/deprecated/self-closing-html-element-renderer.type.js.map +1 -0
  22. package/{dist/cjs → src}/lib/deprecated/self-closing-tag.function.d.ts +1 -0
  23. package/{dist/esm → src}/lib/deprecated/self-closing-tag.function.js +2 -2
  24. package/src/lib/deprecated/self-closing-tag.function.js.map +1 -0
  25. package/{dist/cjs → src}/lib/deprecated/tag.function.d.ts +1 -0
  26. package/{dist/esm → src}/lib/deprecated/tag.function.js +2 -2
  27. package/src/lib/deprecated/tag.function.js.map +1 -0
  28. package/{dist/cjs → src}/lib/deprecated/tags.d.ts +2 -1
  29. package/{dist/esm → src}/lib/deprecated/tags.js +1 -0
  30. package/src/lib/deprecated/tags.js.map +1 -0
  31. package/src/lib/dom/index.d.ts +139 -0
  32. package/src/lib/dom/index.js +142 -0
  33. package/src/lib/dom/index.js.map +1 -0
  34. package/src/lib/dom/lib/constants/style-manager.constant.d.ts +12 -0
  35. package/src/lib/dom/lib/constants/style-manager.constant.js +28 -0
  36. package/src/lib/dom/lib/constants/style-manager.constant.js.map +1 -0
  37. package/src/lib/dom/lib/functions/as-element-factory.function.d.ts +4 -0
  38. package/src/lib/dom/lib/functions/as-element-factory.function.js +22 -0
  39. package/src/lib/dom/lib/functions/as-element-factory.function.js.map +1 -0
  40. package/src/lib/dom/lib/functions/as-id.function.d.ts +2 -0
  41. package/src/lib/dom/lib/functions/as-id.function.js +9 -0
  42. package/src/lib/dom/lib/functions/as-id.function.js.map +1 -0
  43. package/src/lib/dom/lib/functions/extract-style.function.d.ts +2 -0
  44. package/src/lib/dom/lib/functions/extract-style.function.js +7 -0
  45. package/src/lib/dom/lib/functions/extract-style.function.js.map +1 -0
  46. package/src/lib/dom/lib/functions/set-element-attributes.function.d.ts +2 -0
  47. package/src/lib/dom/lib/functions/set-element-attributes.function.js +6 -0
  48. package/src/lib/dom/lib/functions/set-element-attributes.function.js.map +1 -0
  49. package/src/lib/dom/lib/functions/set-element-style.function.d.ts +2 -0
  50. package/src/lib/dom/lib/functions/set-element-style.function.js +6 -0
  51. package/src/lib/dom/lib/functions/set-element-style.function.js.map +1 -0
  52. package/src/lib/dom/lib/functions/set-element-styles.function.d.ts +2 -0
  53. package/src/lib/dom/lib/functions/set-element-styles.function.js +6 -0
  54. package/src/lib/dom/lib/functions/set-element-styles.function.js.map +1 -0
  55. package/src/lib/dom/lib/functions/style-on-focus.function.d.ts +2 -0
  56. package/src/lib/dom/lib/functions/style-on-focus.function.js +8 -0
  57. package/src/lib/dom/lib/functions/style-on-focus.function.js.map +1 -0
  58. package/src/lib/dom/lib/functions/style-on-pointer-enter.function.d.ts +2 -0
  59. package/src/lib/dom/lib/functions/style-on-pointer-enter.function.js +8 -0
  60. package/src/lib/dom/lib/functions/style-on-pointer-enter.function.js.map +1 -0
  61. package/src/lib/dom/lib/functions/style-on.function.d.ts +2 -0
  62. package/src/lib/dom/lib/functions/style-on.function.js +6 -0
  63. package/src/lib/dom/lib/functions/style-on.function.js.map +1 -0
  64. package/src/lib/dom/lib/functions/styled.function.d.ts +2 -0
  65. package/src/lib/dom/lib/functions/styled.function.js +16 -0
  66. package/src/lib/dom/lib/functions/styled.function.js.map +1 -0
  67. package/src/lib/dom/lib/types/css-properties.type.d.ts +5 -0
  68. package/{dist/cjs/lib/deprecated/self-closing-html-element-renderer.type.js → src/lib/dom/lib/types/css-properties.type.js} +1 -0
  69. package/src/lib/dom/lib/types/css-properties.type.js.map +1 -0
  70. package/src/lib/dom/lib/types/element-props.type.d.ts +10 -0
  71. package/{dist/cjs/lib/deprecated/html-element-renderer.type.js → src/lib/dom/lib/types/element-props.type.js} +1 -0
  72. package/src/lib/dom/lib/types/element-props.type.js.map +1 -0
  73. package/{dist/cjs → src}/lib/email-body.function.d.ts +1 -0
  74. package/{dist/esm → src}/lib/email-body.function.js +2 -2
  75. package/src/lib/email-body.function.js.map +1 -0
  76. package/{dist/cjs → src}/lib/primitives/element.function.d.ts +1 -0
  77. package/{dist/esm → src}/lib/primitives/element.function.js +2 -2
  78. package/src/lib/primitives/element.function.js.map +1 -0
  79. package/{dist/cjs → src}/lib/primitives/elements.d.ts +2 -1
  80. package/{dist/esm → src}/lib/primitives/elements.js +1 -2
  81. package/src/lib/primitives/elements.js.map +1 -0
  82. package/src/lib/primitives/format-attributes.function.d.ts +2 -0
  83. package/{dist/esm → src}/lib/primitives/format-attributes.function.js +5 -2
  84. package/src/lib/primitives/format-attributes.function.js.map +1 -0
  85. package/src/lib/primitives/inline-style.function.d.ts +3 -0
  86. package/src/lib/primitives/inline-style.function.js +14 -0
  87. package/src/lib/primitives/inline-style.function.js.map +1 -0
  88. package/{dist/types → src}/lib/primitives/self-closing-element.function.d.ts +2 -1
  89. package/{dist/cjs → src}/lib/primitives/self-closing-element.function.js +2 -2
  90. package/src/lib/primitives/self-closing-element.function.js.map +1 -0
  91. package/{dist/cjs → src}/lib/styles/button-styles.constant.d.ts +1 -0
  92. package/{dist/cjs → src}/lib/styles/button-styles.constant.js +1 -0
  93. package/src/lib/styles/button-styles.constant.js.map +1 -0
  94. package/{dist/types → src}/lib/styles/font-styles.constant.d.ts +1 -0
  95. package/{dist/cjs → src}/lib/styles/font-styles.constant.js +1 -0
  96. package/src/lib/styles/font-styles.constant.js.map +1 -0
  97. package/{dist/cjs → src}/lib/table.function.d.ts +1 -0
  98. package/{dist/cjs → src}/lib/table.function.js +2 -2
  99. package/src/lib/table.function.js.map +1 -0
  100. package/src/lib/types/attributes.type.d.ts +7 -0
  101. package/{dist/esm → src}/lib/types/attributes.type.js +1 -0
  102. package/src/lib/types/attributes.type.js.map +1 -0
  103. package/{dist/cjs → src}/lib/types/element-renderer.type.d.ts +1 -0
  104. package/{dist/esm → src}/lib/types/element-renderer.type.js +1 -0
  105. package/src/lib/types/element-renderer.type.js.map +1 -0
  106. package/{dist/types → src}/lib/types/self-closing-element-renderer.type.d.ts +1 -0
  107. package/{dist/cjs → src}/lib/types/self-closing-element-renderer.type.js +1 -0
  108. package/src/lib/types/self-closing-element-renderer.type.js.map +1 -0
  109. package/dist/cjs/index.js +0 -36
  110. package/dist/cjs/lib/deprecated/a.function.d.ts +0 -1
  111. package/dist/cjs/lib/deprecated/a.function.js +0 -8
  112. package/dist/cjs/lib/deprecated/self-closing-tag.function.js +0 -8
  113. package/dist/cjs/lib/deprecated/tag.function.js +0 -12
  114. package/dist/cjs/lib/deprecated/tags.js +0 -27
  115. package/dist/cjs/lib/email-body.function.js +0 -25
  116. package/dist/cjs/lib/primitives/element.function.js +0 -13
  117. package/dist/cjs/lib/primitives/elements.js +0 -34
  118. package/dist/cjs/lib/primitives/format-attributes.function.d.ts +0 -1
  119. package/dist/cjs/lib/primitives/format-attributes.function.js +0 -9
  120. package/dist/cjs/lib/primitives/inline-style.function.d.ts +0 -1
  121. package/dist/cjs/lib/primitives/inline-style.function.js +0 -10
  122. package/dist/cjs/lib/primitives/self-closing-element.function.d.ts +0 -2
  123. package/dist/cjs/lib/styles/font-styles.constant.d.ts +0 -7
  124. package/dist/cjs/lib/types/attributes.type.d.ts +0 -4
  125. package/dist/cjs/lib/types/attributes.type.js +0 -2
  126. package/dist/cjs/lib/types/element-renderer.type.js +0 -2
  127. package/dist/cjs/lib/types/self-closing-element-renderer.type.d.ts +0 -2
  128. package/dist/esm/index.d.ts +0 -20
  129. package/dist/esm/index.js +0 -36
  130. package/dist/esm/lib/deprecated/html-element-renderer.type.d.ts +0 -1
  131. package/dist/esm/lib/deprecated/html.function.d.ts +0 -1
  132. package/dist/esm/lib/deprecated/html.function.js +0 -43
  133. package/dist/esm/lib/deprecated/login-button.function.d.ts +0 -1
  134. package/dist/esm/lib/deprecated/login-button.function.js +0 -15
  135. package/dist/esm/lib/deprecated/self-closing-html-element-renderer.type.d.ts +0 -1
  136. package/dist/esm/lib/deprecated/self-closing-tag.function.d.ts +0 -1
  137. package/dist/esm/lib/deprecated/tag.function.d.ts +0 -1
  138. package/dist/esm/lib/deprecated/tags.d.ts +0 -24
  139. package/dist/esm/lib/email-body.function.d.ts +0 -2
  140. package/dist/esm/lib/primitives/element.function.d.ts +0 -2
  141. package/dist/esm/lib/primitives/elements.d.ts +0 -26
  142. package/dist/esm/lib/primitives/format-attributes.function.d.ts +0 -1
  143. package/dist/esm/lib/primitives/inline-style.function.d.ts +0 -1
  144. package/dist/esm/lib/primitives/inline-style.function.js +0 -10
  145. package/dist/esm/lib/primitives/self-closing-element.function.d.ts +0 -2
  146. package/dist/esm/lib/primitives/self-closing-element.function.js +0 -8
  147. package/dist/esm/lib/styles/button-styles.constant.d.ts +0 -11
  148. package/dist/esm/lib/styles/button-styles.constant.js +0 -14
  149. package/dist/esm/lib/styles/font-styles.constant.d.ts +0 -7
  150. package/dist/esm/lib/styles/font-styles.constant.js +0 -10
  151. package/dist/esm/lib/table.function.d.ts +0 -1
  152. package/dist/esm/lib/table.function.js +0 -13
  153. package/dist/esm/lib/types/attributes.type.d.ts +0 -4
  154. package/dist/esm/lib/types/element-renderer.type.d.ts +0 -2
  155. package/dist/esm/lib/types/self-closing-element-renderer.type.d.ts +0 -2
  156. package/dist/esm/lib/types/self-closing-element-renderer.type.js +0 -2
  157. package/dist/types/index.d.ts +0 -20
  158. package/dist/types/lib/deprecated/a.function.d.ts +0 -1
  159. package/dist/types/lib/deprecated/html-element-renderer.type.d.ts +0 -1
  160. package/dist/types/lib/deprecated/html.function.d.ts +0 -1
  161. package/dist/types/lib/deprecated/login-button.function.d.ts +0 -1
  162. package/dist/types/lib/deprecated/self-closing-html-element-renderer.type.d.ts +0 -1
  163. package/dist/types/lib/deprecated/self-closing-tag.function.d.ts +0 -1
  164. package/dist/types/lib/deprecated/tag.function.d.ts +0 -1
  165. package/dist/types/lib/deprecated/tags.d.ts +0 -24
  166. package/dist/types/lib/email-body.function.d.ts +0 -2
  167. package/dist/types/lib/primitives/element.function.d.ts +0 -2
  168. package/dist/types/lib/primitives/elements.d.ts +0 -26
  169. package/dist/types/lib/primitives/format-attributes.function.d.ts +0 -1
  170. package/dist/types/lib/primitives/inline-style.function.d.ts +0 -1
  171. package/dist/types/lib/styles/button-styles.constant.d.ts +0 -11
  172. package/dist/types/lib/table.function.d.ts +0 -1
  173. package/dist/types/lib/types/attributes.type.d.ts +0 -4
  174. package/dist/types/lib/types/element-renderer.type.d.ts +0 -2
@@ -1,2 +1,3 @@
1
1
  import { TAttributes } from './types/attributes.type';
2
2
  export declare function emailBody(title: string, subtitle: string, markup: Array<string | number>, logoUrl?: string, extraStyles?: TAttributes['style']): string;
3
+ //# sourceMappingURL=email-body.function.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.emailBody = void 0;
3
+ exports.emailBody = emailBody;
4
4
  const elements_1 = require("./primitives/elements");
5
5
  const font_styles_constant_1 = require("./styles/font-styles.constant");
6
6
  function emailBody(title, subtitle, markup, logoUrl, extraStyles = {}) {
@@ -22,4 +22,4 @@ function emailBody(title, subtitle, markup, logoUrl, extraStyles = {}) {
22
22
  }),
23
23
  ]);
24
24
  }
25
- exports.emailBody = emailBody;
25
+ //# sourceMappingURL=email-body.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-body.function.js","sourceRoot":"","sources":["../../../../../../libs/server/html/src/lib/email-body.function.ts"],"names":[],"mappings":";;AAIA,8BA0BC;AA7BD,oDAAoD;AACpD,wEAA2D;AAE3D,SAAgB,SAAS,CACvB,KAAa,EACb,QAAgB,EAChB,MAA8B,EAC9B,OAAgB,EAChB,cAAoC,EAAE;IAEtC,OAAO,IAAA,cAAG,EAAC;QACT,IAAA,cAAG,EAAC;YACF,IAAA,cAAG,EACD;gBACE,OAAO;oBACL,CAAC,CAAC,sCAAsC,OAAO,MAAM;oBACrD,CAAC,CAAC,SAAS;gBACb,KAAK,CAAC,CAAC,CAAC,IAAA,aAAE,EAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC/B,QAAQ,CAAC,CAAC,CAAC,IAAA,aAAE,EAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;aACtC,CAAC,MAAM,CAAC,OAAO,CAAa,CAC9B;YACD,IAAA,cAAG,EAAC,MAAM,CAAC;SACZ,EAAE;YACD,KAAK,EAAE;gBACL,GAAG,iCAAU;gBACb,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;aACvB;SACF,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { TAttributes } from "../types/attributes.type";
2
2
  export declare function element(tag: string, content: Array<string | number>, attributes?: TAttributes): string;
3
+ //# sourceMappingURL=element.function.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.element = void 0;
3
+ exports.element = element;
4
4
  const format_attributes_function_1 = require("./format-attributes.function");
5
5
  const inline_style_function_1 = require("./inline-style.function");
6
6
  function element(tag, content, attributes) {
@@ -10,4 +10,4 @@ function element(tag, content, attributes) {
10
10
  const styleExp = style ? ` ${(0, inline_style_function_1.inlineStyle)(style)}` : '';
11
11
  return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
12
12
  }
13
- exports.element = element;
13
+ //# sourceMappingURL=element.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.function.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/primitives/element.function.ts"],"names":[],"mappings":";;AAIA,0BAWC;AAdD,6EAAgE;AAChE,mEAAsD;AAEtD,SAAgB,OAAO,CACnB,GAAW,EACX,OAA+B,EAC/B,UAAwB;IAExB,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAK,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,UAAU,IAAI,EAAE,CAAC;IACxE,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,IAAA,6CAAgB,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,IAAA,mCAAW,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvD,OAAO,IAAI,GAAG,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC;AAC1F,CAAC"}
@@ -23,4 +23,5 @@ export declare const td: TElementRenderer;
23
23
  export declare const th: TElementRenderer;
24
24
  export declare const thead: TElementRenderer;
25
25
  export declare const tr: TElementRenderer;
26
- export declare const style: any;
26
+ export declare const style: (content: (string | number)[], attributes?: import("../..").TAttributes | undefined) => string;
27
+ //# sourceMappingURL=elements.d.ts.map
@@ -29,6 +29,5 @@ exports.td = element_function_1.element.bind(null, 'td');
29
29
  exports.th = element_function_1.element.bind(null, 'th');
30
30
  exports.thead = element_function_1.element.bind(null, 'thead');
31
31
  exports.tr = element_function_1.element.bind(null, 'tr');
32
- // todo: make this take a Record<string, Record<string, string>> instead of the terrible raw string formatting used now
33
- // todo: apply kebab-casing to camelCased keys so that consumers can write { fontWeight: 600 } instead of {'font-weight': 600 } (do this for all style properties of primitives' attributes)
34
32
  exports.style = element_function_1.element.bind(null, 'style');
33
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/primitives/elements.ts"],"names":[],"mappings":";;;AACA,yDAA6C;AAE7C,mFAAqE;AACrE,6EAAgE;AAEzD,MAAM,MAAM,GAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAA,0BAAO,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,qCAAY,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAA/I,QAAA,MAAM,UAAyI;AAC/I,QAAA,IAAI,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,GAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAA,0BAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,qCAAY,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAApJ,QAAA,MAAM,UAA8I;AACpJ,QAAA,GAAG,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAClD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,IAAI,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,QAAA,MAAM,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACxD,QAAA,GAAG,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnD,QAAA,GAAG,GAAgC,kDAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACxE,QAAA,IAAI,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,QAAA,CAAC,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC9C,QAAA,GAAG,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAClD,QAAA,GAAG,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpD,QAAA,KAAK,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,QAAA,KAAK,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtD,QAAA,EAAE,GAAqB,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAIhD,QAAA,KAAK,GAAG,0BAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function formatAttributes(attributes?: Record<string, any>): string;
2
+ //# sourceMappingURL=format-attributes.function.d.ts.map
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatAttributes = void 0;
3
+ exports.formatAttributes = formatAttributes;
4
4
  function formatAttributes(attributes) {
5
+ if (!attributes) {
6
+ return '';
7
+ }
5
8
  return Object.entries(attributes)
6
9
  .map(([k, v]) => `${k}="${v}"`)
7
10
  .join(' ');
8
11
  }
9
- exports.formatAttributes = formatAttributes;
12
+ //# sourceMappingURL=format-attributes.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-attributes.function.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/primitives/format-attributes.function.ts"],"names":[],"mappings":";;AAAA,4CAQC;AARD,SAAgB,gBAAgB,CAAC,UAAgC;IAC7D,IAAG,CAAC,UAAU,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;SAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CSSProperties } from '../types/attributes.type';
2
+ export declare function inlineStyle(styles: CSSProperties): string;
3
+ //# sourceMappingURL=inline-style.function.d.ts.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inlineStyle = inlineStyle;
4
+ function inlineStyle(styles) {
5
+ const rules = Object.entries(styles)
6
+ .filter(([, v]) => (v != null) && (v != undefined))
7
+ .map(([k, v]) => {
8
+ const prop = k.replace(/([A-Z])/g, '-$1').toLowerCase();
9
+ return `${prop}: ${v};`;
10
+ })
11
+ .join(' ');
12
+ return `style="${rules}"`;
13
+ }
14
+ //# sourceMappingURL=inline-style.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-style.function.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/primitives/inline-style.function.ts"],"names":[],"mappings":";;AAEA,kCAUC;AAVD,SAAgB,WAAW,CAAC,MAAqB;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC;SAClD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QAEd,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QACxD,OAAO,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC;IAC1B,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,UAAU,KAAK,GAAG,CAAC;AAC5B,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { TAttributes } from "../types/attributes.type";
2
- export declare function selfClosingElement(tag: string, attributes: TAttributes): string;
2
+ export declare function selfClosingElement(tag: string, attributes?: TAttributes): string;
3
+ //# sourceMappingURL=self-closing-element.function.d.ts.map
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selfClosingElement = void 0;
3
+ exports.selfClosingElement = selfClosingElement;
4
4
  const element_function_1 = require("./element.function");
5
5
  function selfClosingElement(tag, attributes) {
6
6
  return (0, element_function_1.element)(tag, [], attributes).replace(`></${tag}>`, '/>');
7
7
  }
8
- exports.selfClosingElement = selfClosingElement;
8
+ //# sourceMappingURL=self-closing-element.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-closing-element.function.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/primitives/self-closing-element.function.ts"],"names":[],"mappings":";;AAGA,gDASC;AAXD,yDAA6C;AAE7C,SAAgB,kBAAkB,CAC9B,GAAW,EACX,UAAwB;IAExB,OAAO,IAAA,0BAAO,EACV,GAAG,EACH,EAAE,EACF,UAAU,CACb,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AACjC,CAAC"}
@@ -9,3 +9,4 @@ export declare const buttonStyles: {
9
9
  'box-sizing': string;
10
10
  color: string;
11
11
  };
12
+ //# sourceMappingURL=button-styles.constant.d.ts.map
@@ -12,3 +12,4 @@ exports.buttonStyles = {
12
12
  'box-sizing': 'border-box',
13
13
  color: 'inherit'
14
14
  };
15
+ //# sourceMappingURL=button-styles.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-styles.constant.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/styles/button-styles.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IACxB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,WAAW;IACnB,eAAe,EAAE,KAAK;IACtB,OAAO,EAAE,cAAc;IACvB,aAAa,EAAE,KAAK;IACpB,YAAY,EAAE,QAAQ;IACtB,iBAAiB,EAAE,MAAM;IACzB,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,SAAS;CACnB,CAAC"}
@@ -5,3 +5,4 @@ export declare const fontStyles: {
5
5
  '-moz-osx-font-smoothing': string;
6
6
  color: string;
7
7
  };
8
+ //# sourceMappingURL=font-styles.constant.d.ts.map
@@ -8,3 +8,4 @@ exports.fontStyles = {
8
8
  '-moz-osx-font-smoothing': `grayscale`,
9
9
  color: 'rgba(0, 0, 0, 0.5) !important',
10
10
  };
11
+ //# sourceMappingURL=font-styles.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-styles.constant.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/styles/font-styles.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,aAAa,EAAE,0JAA0J;IACzK,WAAW,EAAE,OAAO;IACpB,wBAAwB,EAAE,aAAa;IACvC,yBAAyB,EAAE,WAAW;IACtC,KAAK,EAAE,+BAA+B;CACzC,CAAC"}
@@ -1 +1,2 @@
1
1
  export declare function table(columns: string[], rows: Array<any[]>): string;
2
+ //# sourceMappingURL=table.function.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.table = void 0;
3
+ exports.table = table;
4
4
  const elements_1 = require("./primitives/elements");
5
5
  const padding = '0.5rem';
6
6
  const color = 'inherit';
@@ -10,4 +10,4 @@ function table(columns, rows) {
10
10
  (0, elements_1.tbody)(rows.map((row, i) => (0, elements_1.tr)(row.map((cell) => (0, elements_1.td)([cell], { style: { padding, color } })), { style: { 'background-color': i % 2 ? '' : 'rgba(0, 0, 0, 0.2)', padding, color } }))),
11
11
  ], { style: { 'border-collapse': 'collapse', width: '100%', color } });
12
12
  }
13
- exports.table = table;
13
+ //# sourceMappingURL=table.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.function.js","sourceRoot":"","sources":["../../../../../../libs/server/html/src/lib/table.function.ts"],"names":[],"mappings":";;AAIA,sBAYC;AAhBD,oDAAsE;AAEtE,MAAM,OAAO,GAAG,QAAQ,CAAC;AACzB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,SAAgB,KAAK,CAAC,OAAiB,EAAE,IAAkB;IACzD,OAAO,IAAA,cAAG,EAAC;QACT,IAAA,gBAAK,EAAC,CAAC,IAAA,aAAE,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,aAAE,EAAC,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC;QAC9P,IAAA,gBAAK,EACH,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAClB,IAAA,aAAE,EACA,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,aAAE,EAAC,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAC5D,EAAE,KAAK,EAAE,EAAE,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CACrF,CACF,CACF;KACF,EAAE,EAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,EAAC,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CSSProperties } from '../dom/lib/types/css-properties.type';
2
+ export { CSSProperties };
3
+ export type TAttributes = Record<string, any> & {
4
+ cssClass?: string;
5
+ style?: CSSProperties;
6
+ };
7
+ //# sourceMappingURL=attributes.type.d.ts.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=attributes.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.type.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/types/attributes.type.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
1
  import { TAttributes } from "./attributes.type";
2
2
  export type TElementRenderer = (content: Array<string | number>, attributes?: TAttributes) => string;
3
+ //# sourceMappingURL=element-renderer.type.d.ts.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=element-renderer.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-renderer.type.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/types/element-renderer.type.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
1
  import { TAttributes } from "./attributes.type";
2
2
  export type TSelfClosingElementRenderer = (attributes?: TAttributes) => string;
3
+ //# sourceMappingURL=self-closing-element-renderer.type.d.ts.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=self-closing-element-renderer.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-closing-element-renderer.type.js","sourceRoot":"","sources":["../../../../../../../libs/server/html/src/lib/types/self-closing-element-renderer.type.ts"],"names":[],"mappings":""}
package/dist/cjs/index.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./lib/deprecated/a.function"), exports);
18
- __exportStar(require("./lib/deprecated/html-element-renderer.type"), exports);
19
- __exportStar(require("./lib/deprecated/html.function"), exports);
20
- __exportStar(require("./lib/deprecated/login-button.function"), exports);
21
- __exportStar(require("./lib/deprecated/self-closing-html-element-renderer.type"), exports);
22
- __exportStar(require("./lib/deprecated/self-closing-tag.function"), exports);
23
- __exportStar(require("./lib/deprecated/tag.function"), exports);
24
- __exportStar(require("./lib/deprecated/tags"), exports);
25
- __exportStar(require("./lib/primitives/element.function"), exports);
26
- __exportStar(require("./lib/primitives/elements"), exports);
27
- __exportStar(require("./lib/primitives/format-attributes.function"), exports);
28
- __exportStar(require("./lib/primitives/inline-style.function"), exports);
29
- __exportStar(require("./lib/primitives/self-closing-element.function"), exports);
30
- __exportStar(require("./lib/styles/button-styles.constant"), exports);
31
- __exportStar(require("./lib/styles/font-styles.constant"), exports);
32
- __exportStar(require("./lib/types/attributes.type"), exports);
33
- __exportStar(require("./lib/types/element-renderer.type"), exports);
34
- __exportStar(require("./lib/types/self-closing-element-renderer.type"), exports);
35
- __exportStar(require("./lib/email-body.function"), exports);
36
- __exportStar(require("./lib/table.function"), exports);
@@ -1 +0,0 @@
1
- export declare function a(text: string, href: string, cssClass?: string): string;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.a = void 0;
4
- function a(text, href, cssClass) {
5
- const classExp = cssClass ? `class="${cssClass}"` : '';
6
- return `<a target="_blank" href="${href}" ${classExp}>${text}</a>`;
7
- }
8
- exports.a = a;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selfClosingTag = void 0;
4
- const tag_function_1 = require("./tag.function");
5
- function selfClosingTag(tag, cssClass, attributes, styles) {
6
- return (0, tag_function_1.tag)(tag, [], cssClass, attributes, styles).replace(`></${tag}>`, '/>');
7
- }
8
- exports.selfClosingTag = selfClosingTag;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tag = void 0;
4
- const format_attributes_function_1 = require("../primitives/format-attributes.function");
5
- const inline_style_function_1 = require("../primitives/inline-style.function");
6
- function tag(tag, content, cssClass, attributes, styles) {
7
- const classExp = cssClass ? ` class="${cssClass}"` : '';
8
- const attributesExp = attributes ? ` ${(0, format_attributes_function_1.formatAttributes)(attributes)}` : '';
9
- const styleExp = styles ? ` ${(0, inline_style_function_1.inlineStyle)(styles)}` : '';
10
- return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
11
- }
12
- exports.tag = tag;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._style = exports._tr = exports._thead = exports._th = exports._td = exports._tbody = exports._tab = exports._pre = exports._p = exports._main = exports._img = exports._htm = exports._header = exports._head = exports._h6 = exports._h5 = exports._h4 = exports._h3 = exports._h2 = exports._h1 = exports._div = exports._body = void 0;
4
- const self_closing_tag_function_1 = require("./self-closing-tag.function");
5
- const tag_function_1 = require("./tag.function");
6
- exports._body = tag_function_1.tag.bind(null, 'body');
7
- exports._div = tag_function_1.tag.bind(null, 'div');
8
- exports._h1 = tag_function_1.tag.bind(null, 'h1');
9
- exports._h2 = tag_function_1.tag.bind(null, 'h2');
10
- exports._h3 = tag_function_1.tag.bind(null, 'h3');
11
- exports._h4 = tag_function_1.tag.bind(null, 'h4');
12
- exports._h5 = tag_function_1.tag.bind(null, 'h5');
13
- exports._h6 = tag_function_1.tag.bind(null, 'h6');
14
- exports._head = tag_function_1.tag.bind(null, 'head');
15
- exports._header = tag_function_1.tag.bind(null, 'header');
16
- exports._htm = tag_function_1.tag.bind(null, 'html');
17
- exports._img = self_closing_tag_function_1.selfClosingTag.bind(null, 'img');
18
- exports._main = tag_function_1.tag.bind(null, 'main');
19
- exports._p = tag_function_1.tag.bind(null, 'p');
20
- exports._pre = tag_function_1.tag.bind(null, 'pre');
21
- exports._tab = tag_function_1.tag.bind(null, 'table');
22
- exports._tbody = tag_function_1.tag.bind(null, 'tbody');
23
- exports._td = tag_function_1.tag.bind(null, 'td');
24
- exports._th = tag_function_1.tag.bind(null, 'th');
25
- exports._thead = tag_function_1.tag.bind(null, 'thead');
26
- exports._tr = tag_function_1.tag.bind(null, 'tr');
27
- exports._style = tag_function_1.tag.bind(null, 'style');
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.emailBody = void 0;
4
- const elements_1 = require("./primitives/elements");
5
- const font_styles_constant_1 = require("./styles/font-styles.constant");
6
- function emailBody(title, subtitle, markup, logoUrl, extraStyles = {}) {
7
- return (0, elements_1.div)([
8
- (0, elements_1.div)([
9
- (0, elements_1.div)([
10
- logoUrl
11
- ? `<img height="64" width="auto" src="${logoUrl}" />`
12
- : undefined,
13
- title ? (0, elements_1.h1)([title]) : undefined,
14
- subtitle ? (0, elements_1.h2)([subtitle]) : undefined,
15
- ].filter(Boolean)),
16
- (0, elements_1.div)(markup),
17
- ], {
18
- style: {
19
- ...font_styles_constant_1.fontStyles,
20
- ...(extraStyles || {})
21
- }
22
- }),
23
- ]);
24
- }
25
- exports.emailBody = emailBody;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.element = void 0;
4
- const format_attributes_function_1 = require("./format-attributes.function");
5
- const inline_style_function_1 = require("./inline-style.function");
6
- function element(tag, content, attributes) {
7
- const { cssClass = '', style = undefined, ...attrs } = attributes || {};
8
- const classExp = cssClass ? ` class="${cssClass}"` : '';
9
- const attributesExp = attrs ? ` ${(0, format_attributes_function_1.formatAttributes)(attrs)}` : '';
10
- const styleExp = style ? ` ${(0, inline_style_function_1.inlineStyle)(style)}` : '';
11
- return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
12
- }
13
- exports.element = element;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.style = exports.tr = exports.thead = exports.th = exports.td = exports.tbody = exports.tab = exports.pre = exports.p = exports.main = exports.img = exports.htm = exports.header = exports.head = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.div = exports.button = exports.body = exports.anchor = void 0;
4
- const element_function_1 = require("./element.function");
5
- const self_closing_element_function_1 = require("./self-closing-element.function");
6
- const button_styles_constant_1 = require("../styles/button-styles.constant");
7
- const anchor = (content, attributes) => (0, element_function_1.element)('a', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
8
- exports.anchor = anchor;
9
- exports.body = element_function_1.element.bind(null, 'body');
10
- const button = (content, attributes) => (0, element_function_1.element)('button', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
11
- exports.button = button;
12
- exports.div = element_function_1.element.bind(null, 'div');
13
- exports.h1 = element_function_1.element.bind(null, 'h1');
14
- exports.h2 = element_function_1.element.bind(null, 'h2');
15
- exports.h3 = element_function_1.element.bind(null, 'h3');
16
- exports.h4 = element_function_1.element.bind(null, 'h4');
17
- exports.h5 = element_function_1.element.bind(null, 'h5');
18
- exports.h6 = element_function_1.element.bind(null, 'h6');
19
- exports.head = element_function_1.element.bind(null, 'head');
20
- exports.header = element_function_1.element.bind(null, 'header');
21
- exports.htm = element_function_1.element.bind(null, 'html');
22
- exports.img = self_closing_element_function_1.selfClosingElement.bind(null, 'img');
23
- exports.main = element_function_1.element.bind(null, 'main');
24
- exports.p = element_function_1.element.bind(null, 'p');
25
- exports.pre = element_function_1.element.bind(null, 'pre');
26
- exports.tab = element_function_1.element.bind(null, 'table');
27
- exports.tbody = element_function_1.element.bind(null, 'tbody');
28
- exports.td = element_function_1.element.bind(null, 'td');
29
- exports.th = element_function_1.element.bind(null, 'th');
30
- exports.thead = element_function_1.element.bind(null, 'thead');
31
- exports.tr = element_function_1.element.bind(null, 'tr');
32
- // todo: make this take a Record<string, Record<string, string>> instead of the terrible raw string formatting used now
33
- // todo: apply kebab-casing to camelCased keys so that consumers can write { fontWeight: 600 } instead of {'font-weight': 600 } (do this for all style properties of primitives' attributes)
34
- exports.style = element_function_1.element.bind(null, 'style');
@@ -1 +0,0 @@
1
- export declare function formatAttributes(attributes: Record<string, any>): string;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatAttributes = void 0;
4
- function formatAttributes(attributes) {
5
- return Object.entries(attributes)
6
- .map(([k, v]) => `${k}="${v}"`)
7
- .join(' ');
8
- }
9
- exports.formatAttributes = formatAttributes;
@@ -1 +0,0 @@
1
- export declare function inlineStyle(styles: Record<string, string>): string;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.inlineStyle = void 0;
4
- function inlineStyle(styles) {
5
- const rules = Object.entries(styles)
6
- .map(([k, v]) => `${k}: ${v};`)
7
- .join(' ');
8
- return `style="${rules}"`;
9
- }
10
- exports.inlineStyle = inlineStyle;
@@ -1,2 +0,0 @@
1
- import { TAttributes } from "../types/attributes.type";
2
- export declare function selfClosingElement(tag: string, attributes: TAttributes): string;
@@ -1,7 +0,0 @@
1
- export declare const fontStyles: {
2
- 'font-family': string;
3
- 'font-size': string;
4
- '-webkit-font-smoothing': string;
5
- '-moz-osx-font-smoothing': string;
6
- color: string;
7
- };
@@ -1,4 +0,0 @@
1
- export type TAttributes = Record<string, any> & {
2
- cssClass?: string;
3
- style?: Record<string, string>;
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- import { TAttributes } from "./attributes.type";
2
- export type TSelfClosingElementRenderer = (attributes?: TAttributes) => string;
@@ -1,20 +0,0 @@
1
- export * from './lib/deprecated/a.function';
2
- export * from './lib/deprecated/html-element-renderer.type';
3
- export * from './lib/deprecated/html.function';
4
- export * from './lib/deprecated/login-button.function';
5
- export * from './lib/deprecated/self-closing-html-element-renderer.type';
6
- export * from './lib/deprecated/self-closing-tag.function';
7
- export * from './lib/deprecated/tag.function';
8
- export * from './lib/deprecated/tags';
9
- export * from './lib/primitives/element.function';
10
- export * from './lib/primitives/elements';
11
- export * from './lib/primitives/format-attributes.function';
12
- export * from './lib/primitives/inline-style.function';
13
- export * from './lib/primitives/self-closing-element.function';
14
- export * from './lib/styles/button-styles.constant';
15
- export * from './lib/styles/font-styles.constant';
16
- export * from './lib/types/attributes.type';
17
- export * from './lib/types/element-renderer.type';
18
- export * from './lib/types/self-closing-element-renderer.type';
19
- export * from './lib/email-body.function';
20
- export * from './lib/table.function';
package/dist/esm/index.js DELETED
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./lib/deprecated/a.function"), exports);
18
- __exportStar(require("./lib/deprecated/html-element-renderer.type"), exports);
19
- __exportStar(require("./lib/deprecated/html.function"), exports);
20
- __exportStar(require("./lib/deprecated/login-button.function"), exports);
21
- __exportStar(require("./lib/deprecated/self-closing-html-element-renderer.type"), exports);
22
- __exportStar(require("./lib/deprecated/self-closing-tag.function"), exports);
23
- __exportStar(require("./lib/deprecated/tag.function"), exports);
24
- __exportStar(require("./lib/deprecated/tags"), exports);
25
- __exportStar(require("./lib/primitives/element.function"), exports);
26
- __exportStar(require("./lib/primitives/elements"), exports);
27
- __exportStar(require("./lib/primitives/format-attributes.function"), exports);
28
- __exportStar(require("./lib/primitives/inline-style.function"), exports);
29
- __exportStar(require("./lib/primitives/self-closing-element.function"), exports);
30
- __exportStar(require("./lib/styles/button-styles.constant"), exports);
31
- __exportStar(require("./lib/styles/font-styles.constant"), exports);
32
- __exportStar(require("./lib/types/attributes.type"), exports);
33
- __exportStar(require("./lib/types/element-renderer.type"), exports);
34
- __exportStar(require("./lib/types/self-closing-element-renderer.type"), exports);
35
- __exportStar(require("./lib/email-body.function"), exports);
36
- __exportStar(require("./lib/table.function"), exports);
@@ -1 +0,0 @@
1
- export type THtmlElementRenderer = (content: Array<string | number>, cssClass?: string, attributes?: Record<string, any>, styles?: Record<string, string>) => string;
@@ -1 +0,0 @@
1
- export declare function html(title: string, subtitle: string, markup: Array<string | number>, logoUrl?: string): string;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.html = void 0;
4
- const tags_1 = require("./tags");
5
- function html(title, subtitle, markup, logoUrl) {
6
- return (0, tags_1._htm)([
7
- (0, tags_1._head)([
8
- (0, tags_1._style)([
9
- 'body {',
10
- 'padding: 64px;',
11
- `font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";`,
12
- `font-size: 1rem;`,
13
- `-webkit-font-smoothing: antialiased;`,
14
- `-moz-osx-font-smoothing: grayscale;`,
15
- 'color: rgb(34, 30, 31);',
16
- '}',
17
- 'h1, h2, h3, h4, pre { color: rgb(34, 30, 31) !important; }',
18
- 'td, th { text-align: left; padding: 8px;}',
19
- 'table { border-collapse: collapse; width: 100%;}',
20
- 'tbody { border-width: 1px; border-style: solid; border-left-style: none; border-right-style: none; }',
21
- '.focal, a { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; }',
22
- '.mw-880 { max-width: 880px !important; margin: auto; }',
23
- '.mw-440 { max-width: 440px !important; margin: auto; }',
24
- 'pre { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; border: solid 1px; }',
25
- 'a { max-width: 240px; }',
26
- '.bg-gray { background-color: #efefef; }',
27
- '.drop-shadow, .button { filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.3)); }',
28
- '.button { text-decoration: none; margin: 32px 0; background-color: rgb(205, 62, 71); color: white !important; }',
29
- ]),
30
- ]),
31
- (0, tags_1._body)([
32
- (0, tags_1._header)([
33
- logoUrl
34
- ? `<img height="64" width="auto" src="${logoUrl}" />`
35
- : undefined,
36
- (0, tags_1._h1)([title]),
37
- (0, tags_1._h2)([subtitle]),
38
- ].filter(Boolean)),
39
- (0, tags_1._main)(markup),
40
- ]),
41
- ]);
42
- }
43
- exports.html = html;
@@ -1 +0,0 @@
1
- export declare function loginButton(text: string, href: string, extraStyles?: Record<string, string>): string;