@rws-framework/client 2.21.1 → 2.21.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.
@@ -37,8 +37,8 @@ module.exports = async function(content) {
37
37
  let templateName = null;
38
38
  let stylesPath = null;
39
39
 
40
- if(decoratorData.decoratorArgs){
41
- const decoratorArgs = json5.parse(decoratorData.decoratorArgs)
40
+ if(decoratorData.decoratorArgs){
41
+ const decoratorArgs = decoratorData.decoratorArgs
42
42
 
43
43
  if(decoratorArgs.template){
44
44
  templateName = decoratorData.decoratorArgs.template || null;
@@ -1,4 +1,5 @@
1
1
  const path = require('path');
2
+ const json5 = require('json5');
2
3
  const fs = require('fs');
3
4
  const os = require('os');
4
5
 
@@ -191,14 +192,22 @@ function extractRWSViewArgs(content, noReplace = false) {
191
192
 
192
193
  let fastOptions = _defaultRWSLoaderOptions.fastOptions;
193
194
 
195
+ if(decoratorArgs && decoratorArgs !== ''){
196
+ try {
197
+ decoratorArgs = json5.parse(decoratorArgs);
198
+ }catch(e){
199
+
200
+ }
201
+ }
202
+
194
203
  if (decoratorArgs && decoratorArgs.fastElementOptions) {
195
204
  fastOptions = decoratorArgs.fastElementOptions;
196
205
  }
197
206
 
198
207
  let replacedDecorator = null;
199
208
 
200
- if(!noReplace){
201
- const [addedParamDefs, addedParams] = _extractRWSViewDefs(fastOptions, decoratorArgs);
209
+ if(!noReplace){
210
+ const [addedParamDefs, addedParams] = _extractRWSViewDefs(fastOptions, decoratorArgs);
202
211
  const replacedViewDecoratorContent = processedContent.replace(
203
212
  viewReg,
204
213
  `@RWSView('$1', null, { template: rwsTemplate, styles${addedParams.length ? ', options: {' + (addedParams.join(', ')) + '}' : ''} })\n$3class $4 extends RWSViewComponent `
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.21.1",
4
+ "version": "2.21.2",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -11,7 +11,9 @@ import { handleExternalChange } from './_attrs/_external_handler';
11
11
  interface RWSDecoratorOptions {
12
12
  template?: string,
13
13
  styles?: string,
14
- fastElementOptions?: any,
14
+ fastElementOptions?: {
15
+ shadowOptions?: ShadowRootInit
16
+ },
15
17
  ignorePackaging?: boolean,
16
18
  debugPackaging?: boolean
17
19
  oreoMode?: boolean