@storyteq/platform-integration 0.0.5 → 0.0.6

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
@@ -43,6 +43,10 @@ __destroy()__
43
43
 
44
44
  Destroy the currently active page instance.
45
45
 
46
+ ## Production usage
47
+
48
+ In order for the generated iframe to load correctly, your domains need to be whitelisted in our Content-Security-Policy headers. Please share your testing and production domains with us so we can add them as allowed frame-ancestors.
49
+
46
50
  ## Available pages
47
51
 
48
52
  ### Create media form
@@ -79,4 +83,111 @@ const crmAnalyticsPage = new StoryteqPlatform.crmAnalyticsPage(
79
83
 
80
84
  crmAnalyticsPage
81
85
  .on('loaded', () => console.log('loaded'));
82
- ```
86
+ ```
87
+
88
+ ## Create Media form Advanced Configuration Options / UI customization
89
+
90
+ The integration supports additional configuration options that allows you to customize the media creation UI/UX.
91
+
92
+ __Advanced Configuration Example__
93
+ ```js
94
+ const createMediaPage = new StoryteqPlatform.createMediaPage(
95
+ '#element-to-spawn-into',
96
+ 'AUTH_TOKEN',
97
+ 1000, // template ID,
98
+ {
99
+ assetManagerScope: [], // Scope the asset selection to a set of asset providers
100
+ publish: [ {} ], // Upon rendering completion, publish to this channel
101
+ mediaRecreateHash: '11abcaaaa0abcdabcabcabca49abx321',
102
+ ui: {
103
+ forceMediaPreviewBeforeCreate: 'always',
104
+ customizationItems: [
105
+ {
106
+ item: 'host_product_name',
107
+ value: 'Storyteq',
108
+ },
109
+ {
110
+ item: 'media_alias',
111
+ value: 'Media',
112
+ },
113
+ {
114
+ item: 'button_media_create',
115
+ value: 'Publish',
116
+ },
117
+ {
118
+ item: 'end_screen_title',
119
+ value: 'Your asset is being published.',
120
+ },
121
+ {
122
+ item: 'end_screen_subtitle',
123
+ value: 'Your asset will appear in your personal assets when finished.',
124
+ },
125
+ {
126
+ item: 'color_theme_hex',
127
+ value: '#999999'
128
+ },
129
+ {
130
+ item: 'full_screen',
131
+ value: true
132
+ }
133
+ ],
134
+ endScreenActions: [
135
+ {
136
+ action: 'create_another_media',
137
+ value: 'Create Another Media',
138
+ },
139
+ ],
140
+ },
141
+ },
142
+ );
143
+
144
+ createMediaPage
145
+ .on('loaded', () => console.log('loaded'))
146
+ .on('created', (media) => {
147
+ console.log({ media });
148
+ });
149
+ ```
150
+
151
+ #### General configuration Attributes
152
+
153
+ ##### mediaRecreateHash
154
+ \
155
+ By setting the value of ```mediaRecreateHash``` to a media hash, all parameter values that was used to create this media will be directly applied in the media create form.
156
+
157
+ #### UI Configuration Attributes
158
+
159
+ ##### forceMediaPreviewBeforeCreate
160
+ \
161
+ For after effects template, ```forceMediaPreviewBeforeCreate``` allows you to enfore the creation of a 'rich preview' before action creation/publishing can be made.
162
+
163
+ | Option (string) | Description |
164
+ | ------ | ------ |
165
+ | always | Always enforce rich preview before creation, even after changes are applied |
166
+ | on_first_render | Only enfore rich preview once. Changing parmater values will not enforce a new preview. |
167
+
168
+ ##### customizationItems
169
+ \
170
+ ```customizationItems``` is an array of configuration objects which allow you to customize the general UI.
171
+ \
172
+ Possible configurations:
173
+
174
+ | Attribute | Description | Option(s) |
175
+ | ------ | ------ | ------ |
176
+ | host_product_name | Name of your company/product | Free text (string)
177
+ | media_alias | Alias of media/creative | Free text (string)
178
+ | button_media_create | Media create button custom description/text | Free text (string)
179
+ | end_screen_title | Title of the screen indicating a media has been created/published | Free text (string)
180
+ | end_screen_subtitle | Subtitle of the screen indicating a media has been created/published | Free text (string)
181
+ | color_theme_hex | Color theme of UI elements such as buttons, loading bars, etc. | Hex code (string)
182
+ | full_screen | Choice of having the create form cover the whole screen or not | true/false
183
+
184
+ ##### endScreenActions
185
+ \
186
+ ```endScreenActions``` is an array of configuration objects that allows you to customize the UI of the 'end screen', by adding certain actions.
187
+ The end screen is what appears after you have initiated the creation/publishing of a media.
188
+ \
189
+ Possible configurations:
190
+
191
+ | Attribute/Action | Description | Option(s) |
192
+ | ------ | ------ | ------ |
193
+ | create_another_media | By including this, a button will appear that allow you to recreate a media | Free text (string, inside button)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyteq/platform-integration",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Integrate with views from the Storyteq platform",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/storyteq/platform-integration.git"
13
+ "url": "git@gitlab.com:storyteq1/Platform/platform-integration.git"
14
14
  },
15
15
  "keywords": [
16
16
  "storyteq"
@@ -3,10 +3,10 @@ import queryString from 'query-string';
3
3
  import activeFrameUrl from '../get-frame-url.js';
4
4
 
5
5
  class BaseFrameController {
6
- constructor(spawnElement, authToken, uri, config) {
6
+ constructor(spawnElement, authToken, uri, config, templateId) {
7
7
  this.spawnElement = spawnElement;
8
8
  const queryParams = queryString.stringify({ no_navigation: true, config });
9
- this.url = `${activeFrameUrl()}/?auth_token=${authToken}/#${uri}?${queryParams}`;
9
+ this.url = `${activeFrameUrl()}${uri}?auth_token=${authToken}&templateId=${templateId}&${queryParams}`;
10
10
  this._init();
11
11
  this.eventListeners = [];
12
12
  }
@@ -2,11 +2,12 @@ import BaseFrameController from './BaseFrameController';
2
2
 
3
3
  class CreateMediaPage extends BaseFrameController{
4
4
  constructor(spawnElement, STauthToken, templateId, config) {
5
- const page = `/content/templates/${templateId}/media/create`;
6
- super(spawnElement, STauthToken, page, JSON.stringify(config));
5
+ const page = '/integration';
6
+ super(spawnElement, STauthToken, page, JSON.stringify(config), templateId);
7
7
  this.availableEvents = [
8
8
  'loaded',
9
9
  'created',
10
+ 'batch-created',
10
11
  ];
11
12
  }
12
13
  }