@pageboard/html 0.11.23 → 0.11.25

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.
@@ -0,0 +1,87 @@
1
+ exports.heading = {
2
+ title: "Heading",
3
+ priority: 10,
4
+ properties: {
5
+ level: {
6
+ title: 'Level',
7
+ description: 'Between 1 and 6',
8
+ type: "integer",
9
+ default: 1,
10
+ minimum: 1,
11
+ maximum: 6
12
+ },
13
+ align: {
14
+ title: 'Align',
15
+ default: "left",
16
+ anyOf: [{
17
+ const: "left",
18
+ title: "Left",
19
+ icon: '<i class="icon align left"></i>'
20
+ }, {
21
+ const: "center",
22
+ title: "Center",
23
+ icon: '<i class="icon align center"></i>'
24
+ }, {
25
+ const: "right",
26
+ title: "Right",
27
+ icon: '<i class="icon align right"></i>'
28
+ }, {
29
+ const: "justify",
30
+ title: "Justify",
31
+ icon: '<i class="icon align justify"></i>'
32
+ }]
33
+ },
34
+ linkable: {
35
+ title: 'Show hash link',
36
+ description: 'On hover',
37
+ type: 'boolean',
38
+ default: false
39
+ },
40
+ id: {
41
+ nullable: true,
42
+ type: 'string',
43
+ pattern: /^[a-z0-9-]*$/.source
44
+ },
45
+ entitled: {
46
+ title: 'H1 is a page title',
47
+ type: 'boolean',
48
+ nullable: true
49
+ }
50
+ },
51
+ contents: {
52
+ id: 'text',
53
+ nodes: "inline*"
54
+ },
55
+ group: "block",
56
+ icon: '<i class="icon header"></i>',
57
+ tag: 'h1,h2,h3,h4,h5,h6',
58
+ html: `<h[level] class="ui [align|or:left] aligned header" is="h[level]-helper" id="[id]" entitled="[entitled]">
59
+ <a aria-hidden="true" href="[$loc.pathname][$loc.search][id|pre:#]">[linkable|bmagnet]#</a>
60
+ <div block-content="text">Heading</div>
61
+ </hn>`,
62
+ parse: function (dom) {
63
+ return {
64
+ level: parseInt(dom.nodeName.substring(1))
65
+ };
66
+ },
67
+ stylesheets: [
68
+ '../ui/heading.css'
69
+ ],
70
+ scripts: [
71
+ '../ui/heading.js'
72
+ ],
73
+ resources: {
74
+ helper: '../ui/heading-helper.js'
75
+ },
76
+ install: function (scope) {
77
+ if (scope.$write) Pageboard.load.js(this.resources.helper, scope);
78
+ }
79
+ };
80
+
81
+
82
+ exports.heading_nolink = {
83
+ ...exports.heading,
84
+ group: null,
85
+ contents: { ...exports.heading.contents, marks: "nolink" }
86
+ };
87
+
@@ -81,18 +81,6 @@ exports.strike = {
81
81
  html: '<s></s>'
82
82
  };
83
83
 
84
- exports.u = {
85
- priority: 107,
86
- title: "Strike",
87
- icon: '<i class="underline icon"></i>',
88
- contents: "text*",
89
- inline: true,
90
- inplace: true,
91
- group: "inline nolink",
92
- tag: 'u',
93
- html: '<u></u>'
94
- };
95
-
96
84
  exports.caps = {
97
85
  priority: 108,
98
86
  title: "Capitalization",
@@ -1,5 +1,4 @@
1
1
  exports.paragraph_nolink = { ...exports.paragraph,
2
- priority: exports.paragraph.priority - 1,
3
2
  group: null,
4
3
  contents: {
5
4
  nodes: "inline*",
@@ -87,85 +86,6 @@ exports.segment = {
87
86
  ]
88
87
  };
89
88
 
90
- exports.heading = {
91
- title: "Heading",
92
- properties: {
93
- level: {
94
- title: 'Level',
95
- description: 'Between 1 and 6',
96
- type: "integer",
97
- default: 1,
98
- minimum: 1,
99
- maximum: 6
100
- },
101
- align: {
102
- title: 'Align',
103
- default: "left",
104
- anyOf: [{
105
- const: "left",
106
- title: "Left",
107
- icon: '<i class="icon align left"></i>'
108
- }, {
109
- const: "center",
110
- title: "Center",
111
- icon: '<i class="icon align center"></i>'
112
- }, {
113
- const: "right",
114
- title: "Right",
115
- icon: '<i class="icon align right"></i>'
116
- }, {
117
- const: "justify",
118
- title: "Justify",
119
- icon: '<i class="icon align justify"></i>'
120
- }]
121
- },
122
- linkable: {
123
- title: 'Show hash link',
124
- description: 'On hover',
125
- type: 'boolean',
126
- default: false
127
- },
128
- id: {
129
- nullable: true,
130
- type: 'string',
131
- pattern: /^[a-z0-9-]*$/.source
132
- }
133
- },
134
- contents: {
135
- id: 'text',
136
- nodes: "inline*"
137
- },
138
- group: "block",
139
- icon: '<i class="icon header"></i>',
140
- tag: 'h1,h2,h3,h4,h5,h6',
141
- html: `<h[level] class="ui [align|or:left] aligned header" is="h[level]-helper" id="[id]">
142
- <a aria-hidden="true" href="[$loc.pathname][$loc.search][id|pre:#]">[linkable|bmagnet]#</a>
143
- <div block-content="text">Heading</div>
144
- </hn>`,
145
- parse: function(dom) {
146
- return {
147
- level: parseInt(dom.nodeName.substring(1))
148
- };
149
- },
150
- stylesheets: [
151
- '../ui/heading.css'
152
- ],
153
- resources: {
154
- helper: '../ui/heading-helper.js'
155
- },
156
- install: function(scope) {
157
- if (scope.$write) Pageboard.load.js(this.resources.helper, scope);
158
- }
159
- };
160
-
161
-
162
- exports.heading_nolink = {
163
- ...exports.heading,
164
- priority: exports.heading.priority - 1,
165
- group: null,
166
- contents: { ...exports.heading.contents, marks: "nolink" }
167
- };
168
-
169
89
  exports.divider = {
170
90
  title: "Divider",
171
91
  group: "block",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.11.23",
3
+ "version": "0.11.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/heading.js ADDED
@@ -0,0 +1,8 @@
1
+ Page.patch(state => {
2
+ state.finish(() => {
3
+ const entitled = document.querySelector('h1[entitled]');
4
+ if (entitled) {
5
+ document.title = entitled.textContent + ' - ' + document.title;
6
+ }
7
+ });
8
+ });
package/ui/sitemap.js CHANGED
@@ -72,7 +72,7 @@ class HTMLElementSitemap extends VirtualHTMLElement {
72
72
  }
73
73
  }
74
74
 
75
- Page.ready(() => {
76
- VirtualHTMLElement.define('element-sitemap', HTMLElementSitemap);
77
- });
75
+
76
+ VirtualHTMLElement.define('element-sitemap', HTMLElementSitemap);
77
+
78
78