@shijiu/jsview-vue 0.9.282 → 0.9.287

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview-vue",
3
- "version": "0.9.282",
3
+ "version": "0.9.287",
4
4
  "bin": {
5
5
  "jsview-post-build": "./scripts/jsview-post-build.js",
6
6
  "jsview-post-install": "./scripts/jsview-post-install.js",
@@ -210,7 +210,9 @@ function compileAndSaveImportedNode(styleFilePath, styleNodes) {
210
210
  let styleContent = "";
211
211
 
212
212
  styleNodes.forEach(node => {
213
- if(!!node.selector) {
213
+ if(node.name === "keyframes") {
214
+ styleContent += compileKeyframesNode(node);
215
+ } else if(!!node.selector) {
214
216
  styleContent += compileSelectorNode(node);
215
217
  styleSelectors.add(node.selector);
216
218
  } else {
@@ -237,13 +239,39 @@ function compileAndSaveImportedNode(styleFilePath, styleNodes) {
237
239
  };
238
240
  }
239
241
 
242
+ function getStringOffset(source, line, column) {
243
+ check(!isNaN(line), source, "JsView Error: Failed to get string offset, line is NaN.");
244
+ check(!isNaN(column), source, "JsView Error: Failed to get string offset, column is NaN.");
245
+
246
+ line -= 1;
247
+ column -= 1;
248
+
249
+ var offset = 0;
250
+ for (var idx = 0; idx < line; idx++) {
251
+ offset = source.indexOf('\n', offset + 1);
252
+ check(offset >= 0, source, "JsView Error: Failed to get string offset, line=" + line + ", column=" + column);
253
+ }
254
+ offset += column;
255
+
256
+ return offset;
257
+ }
258
+
240
259
  function compileKeyframesNode(node) {
241
260
  const name = node.name;
242
261
  check(name, node.source.input.css, "JsView Error: name is not found!");
243
262
 
244
263
  check(name === "keyframes", node.source.input.css, "JsView Error: @keyframes name is not found!");
245
264
 
246
- const content = node.source.input.css.slice(node.source.start.offset, node.source.end.offset + 1);
265
+ let startOffset = node.source.start.offset;
266
+ let endOffset = node.source.end.offset;
267
+ if (typeof (startOffset) == 'undefined') {
268
+ startOffset = getStringOffset(node.source.input.css, node.source.start.line, node.source.start.column);
269
+ }
270
+ if (typeof (endOffset) == 'undefined') {
271
+ endOffset = getStringOffset(node.source.input.css, node.source.end.line, node.source.end.column);
272
+ }
273
+ const content = node.source.input.css.slice(startOffset, endOffset + 1);
274
+ // console.log('jsview-css-to-js.compileKeyframesNode() \n', startOffset, endOffset, content);
247
275
 
248
276
  let styleContent = "'" + node.params + "':'";
249
277
  styleContent += content.replace(/\n/g, " ");
@@ -16,7 +16,6 @@ import { Options, Vue } from "vue-class-component";
16
16
  props: {
17
17
  onRef: { type: Function, default: () => {} },
18
18
  useTexture: { type: Boolean, default: false },
19
- autoplay: { type: String, default: undefined },
20
19
  },
21
20
  })
22
21
  class JsvVideo extends Vue {