pinstripe 0.26.0 → 0.27.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/lib/component.js +26 -1
- package/lib/components/pinstripe_frame.js +1 -1
- package/lib/components/{script.js → pinstripe_script.js} +0 -2
- package/package.json +3 -3
- /package/lib/components/{a.js → pinstripe_anchor.js} +0 -0
- /package/lib/components/{body.js → pinstripe_body.js} +0 -0
- /package/lib/components/{document.js → pinstripe_document.js} +0 -0
- /package/lib/components/{form.js → pinstripe_form.js} +0 -0
package/lib/component.js
CHANGED
|
@@ -17,7 +17,7 @@ export const Component = Class.extend().include({
|
|
|
17
17
|
if(!node._component){
|
|
18
18
|
node._component = Component.new(node, true);
|
|
19
19
|
node._component = Component.create(
|
|
20
|
-
node._component.attributes['data-component'] || node._component.type,
|
|
20
|
+
node._component.attributes['data-component'] || (node._component.type == '#document' ? 'pinstripe-document' : node._component.type),
|
|
21
21
|
node
|
|
22
22
|
);
|
|
23
23
|
if(node.isConnected) node._component.trigger('init', { bubbles: false });
|
|
@@ -626,6 +626,13 @@ function insert(virtualNode, referenceChild, returnComponent = true){
|
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
+
const COMPONENT_MAP = {
|
|
630
|
+
a: 'pinstripe-anchor',
|
|
631
|
+
body: 'pinstripe-body',
|
|
632
|
+
form: 'pinstripe-body',
|
|
633
|
+
|
|
634
|
+
};
|
|
635
|
+
|
|
629
636
|
function normalizeVirtualNode(){
|
|
630
637
|
if(!this.parent && this.children.some(child => child.type == 'html')){
|
|
631
638
|
this.children = [
|
|
@@ -645,6 +652,24 @@ function normalizeVirtualNode(){
|
|
|
645
652
|
if(this.parent && this.parent.type == 'textarea' && this.type == '#text'){
|
|
646
653
|
this.attributes.value = this.attributes.value.replace(/^\n/, '');
|
|
647
654
|
}
|
|
655
|
+
|
|
656
|
+
if(!this.attributes['data-component']){
|
|
657
|
+
if(this.type == 'a'){
|
|
658
|
+
this.attributes['data-component'] = 'pinstripe-anchor';
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if(this.type == 'body'){
|
|
662
|
+
this.attributes['data-component'] = 'pinstripe-body';
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if(this.type == 'form'){
|
|
666
|
+
this.attributes['data-component'] = 'pinstripe-form';
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if(this.type == 'script' && this.attributes.type == 'pinstripe'){
|
|
670
|
+
this.attributes['data-component'] = 'pinstripe-script';
|
|
671
|
+
}
|
|
672
|
+
}
|
|
648
673
|
}
|
|
649
674
|
|
|
650
675
|
ComponentEvent.Component = Component;
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
this.abort();
|
|
48
48
|
const { method = 'GET', placeholderUrl } = options;
|
|
49
49
|
const cachedHtml = method == 'GET' ? loadCache.get(url.toString()) : undefined;
|
|
50
|
-
|
|
50
|
+
if(cachedHtml) this.patch(cachedHtml);
|
|
51
51
|
let minimumDelay = 0;
|
|
52
52
|
if(!cachedHtml && placeholderUrl){
|
|
53
53
|
const placeholderHtml = loadCache.get(placeholderUrl.toString());
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "pinstripe",
|
|
4
4
|
"description": "Surgically updates your app's DOM when a page changes.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.27.0",
|
|
6
6
|
"author": "Jody Salt",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"exports": {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"clean": "rm -rf ./node_modules"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@blognami/util": "^0.
|
|
16
|
+
"@blognami/util": "^0.27.0"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "git://github.com/blognami/blognami.git",
|
|
21
21
|
"directory": "packages/pinstripe"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "4dfbb8d6cf08202165ebbc34dfef42e718a0d9e5"
|
|
24
24
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|