@matboks/template-core 0.0.1 → 0.0.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.
@@ -35,62 +35,62 @@ export function openCanvasInNewTab(canvas) {
35
35
  export function createHTMLElements() {
36
36
  const cssId = "_" + crypto.randomUUID().slice(0, 8);
37
37
  const template = document.createElement("template");
38
- template.innerHTML = `
39
- <div class="template ${cssId}">
40
- <div class="container ${cssId}">
41
- <div class="frame ${cssId}">
42
- <canvas class="canvas ${cssId}"></canvas>
43
- </div>
44
- </div>
45
- </div>
38
+ template.innerHTML = `
39
+ <div class="template ${cssId}">
40
+ <div class="container ${cssId}">
41
+ <div class="frame ${cssId}">
42
+ <canvas class="canvas ${cssId}"></canvas>
43
+ </div>
44
+ </div>
45
+ </div>
46
46
  `;
47
47
  const styleElement = document.createElement("style");
48
- styleElement.textContent = `
49
-
50
-
51
- .template.${cssId} {
52
- box-sizing: border-box;
53
- width: 100dvw;
54
- height: 100dvh;
55
-
56
- background-color: var(--background-color);
57
- padding-inline: 5dvw;
58
- padding-block: 5dvh;
59
-
60
- display: flex;
61
- justify-content: center;
62
- align-items: center;
63
- }
64
-
65
- :root {
66
- --background-color: #fafafa;
67
- }
68
-
69
- .dark-template {
70
- --background-color: #1a191e;
71
- }
72
-
73
- .container.${cssId} {
74
- width: 100%;
75
- height: 100%;
76
-
77
- display: flex;
78
- justify-content: center;
79
- align-items: center;
80
- }
81
-
82
- .frame.${cssId} {
83
- display: flex;
84
- box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
85
-
86
- padding: 10px;
87
-
88
- background-color: white;
89
- }
90
-
91
- .canvas.${cssId} {
92
- outline: 1px solid rgba(0, 0, 0, 0.07);
93
- }
48
+ styleElement.textContent = `
49
+
50
+
51
+ .template.${cssId} {
52
+ box-sizing: border-box;
53
+ width: 100dvw;
54
+ height: 100dvh;
55
+
56
+ background-color: var(--background-color);
57
+ padding-inline: 5dvw;
58
+ padding-block: 5dvh;
59
+
60
+ display: flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ }
64
+
65
+ :root {
66
+ --background-color: #fafafa;
67
+ }
68
+
69
+ .dark-template {
70
+ --background-color: #1a191e;
71
+ }
72
+
73
+ .container.${cssId} {
74
+ width: 100%;
75
+ height: 100%;
76
+
77
+ display: flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ }
81
+
82
+ .frame.${cssId} {
83
+ display: flex;
84
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
85
+
86
+ padding: 10px;
87
+
88
+ background-color: white;
89
+ }
90
+
91
+ .canvas.${cssId} {
92
+ outline: 1px solid rgba(0, 0, 0, 0.07);
93
+ }
94
94
  `;
95
95
  document.head.appendChild(styleElement);
96
96
  const root = template.content.children[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matboks/template-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "svgcanvas": "^2.6.0",
15
- "@matboks/utilities": "0.0.1"
15
+ "@matboks/utilities": "0.0.2"
16
16
  },
17
17
  "scripts": {
18
18
  "build": "tsc"