designertool 0.23.0 → 0.26.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.
package/README.md CHANGED
@@ -1,11 +1,26 @@
1
1
  <h1 align="center">Postcard Designer Tool</h1>
2
2
 
3
+ ## Links
4
+
5
+ - [Repo](https://github.com/webgurus-eu/dmm-designer-web 'dmm-designer-web Repo')
6
+
7
+ - [Live](<Homepage url> 'Live View')
8
+
9
+ - [API](https://dev-designer.directmailmanager.com/api 'API')
10
+
3
11
  ## User Guide
4
12
 
13
+ To use the package in your project, before installing you need to first create an .npmrc file using the following details:
14
+
15
+ ```sh
16
+ @webgurus-eu:registry=https://npm.pkg.github.com
17
+ //npm.pkg.github.com/:_authToken=${NPM_TOKEN}
18
+ ```
19
+
5
20
  Install the package in your application:
6
21
 
7
22
  ```sh
8
- $ npm install designertool
23
+ npm install designertool
9
24
  ```
10
25
 
11
26
  Default config:
@@ -16,6 +31,9 @@ Default config:
16
31
  "w": 9,
17
32
  "h": 6
18
33
  },
34
+ "flags": {
35
+ "disable_default_templates": false
36
+ },
19
37
  "zoom": 100,
20
38
  "backgroundColor": "#ffffff",
21
39
  "backgroundImage": null,
@@ -100,17 +118,52 @@ Default config:
100
118
  ```
101
119
 
102
120
  Use the component in your application:
103
- In your project entry:
121
+
104
122
  ```js
105
- import { register } from "designertool";
106
- register()
107
- ```
108
- After this you can use the postcard-designer custom html element.
109
- ```html
110
- <postcard-designer />
123
+ <script setup lang="ts">
124
+ import { PostcardDesigner} from "designer-tool";
125
+ import "designer-tool/dist/index.css";
126
+
127
+ </script>
128
+
129
+ <template>
130
+ <PostcardDesigner />
131
+ </template>
132
+
111
133
  ```
112
134
 
135
+ Available functions to modify the default config:
136
+
137
+ - Every option can be modified by calling the init() function except the fonts, which can be extended by calling the addFont() function:
113
138
 
139
+ ```js
140
+ import { init, addFont } from '@webgurus-eu/postcard-designer-tool';
141
+
142
+ init({
143
+ backgroundColor: '#000000',
144
+ return_address: {
145
+ company: '',
146
+ firstname: 'Chuck',
147
+ lastname: 'Norris',
148
+ address1: '420 Forrest St',
149
+ address2: '',
150
+ city: 'Austin',
151
+ state: 'TX',
152
+ zipcode: '34444',
153
+ },
154
+ });
155
+
156
+ addFont([
157
+ {
158
+ name: 'Kablammo',
159
+ link: 'https://fonts.googleapis.com/css?family=Kablammo',
160
+ },
161
+ {
162
+ name: 'Bebas Neue',
163
+ link: 'https://fonts.googleapis.com/css?family=Bebas+Neue',
164
+ },
165
+ ]);
166
+ ```
114
167
 
115
168
  ## Built With
116
169
 
@@ -119,3 +172,6 @@ After this you can use the postcard-designer custom html element.
119
172
  - Vite
120
173
  - Tailwind
121
174
 
175
+ ## Future Updates
176
+
177
+ - [ ] Conversion Tracking
@@ -0,0 +1,4 @@
1
+ type FeatureFlag = 'disable_default_templates';
2
+ type FeatureFlags = Record<FeatureFlag, boolean>;
3
+ export declare const useFeatureFlags: () => FeatureFlags;
4
+ export {};
package/dist/config.d.ts CHANGED
@@ -3,6 +3,10 @@ declare const _default: {
3
3
  w: number;
4
4
  h: number;
5
5
  };
6
+ template_scope: undefined | string;
7
+ flags: {
8
+ disable_default_templates: boolean;
9
+ };
6
10
  zoom: number;
7
11
  backgroundColor: string;
8
12
  backgroundImage: null;