@haxtheweb/create 10.0.4 → 10.0.5

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.
@@ -348,7 +348,7 @@ async function siteCommandDetected(commandRun) {
348
348
  }
349
349
  recipe.log(siteLoggingName, (0, _logging.commandString)(commandRun));
350
350
  } else if (!commandRun.options.quiet) {
351
- (0, _logging.log)('Must specify --item-import as path to valid item export file or URL', 'error');
351
+ (0, _logging.log)('Must specify --items-import as path to valid item export file or URL', 'error');
352
352
  }
353
353
  break;
354
354
  case "start":
@@ -1107,7 +1107,7 @@ async function siteProcess(commandRun, project, port = '3000') {
1107
1107
  if (commandRun.options.importStructure === 'drupal7-book-print-html') {
1108
1108
  let siteContent = await fetch(commandRun.options.importSite).then(d => d.ok ? d.text() : '');
1109
1109
  if (siteContent) {
1110
- // @todo refactor to support 9 levels of heirarchy as this is technically what Drupal supports
1110
+ // @todo refactor to support 9 levels of hierarchy as this is technically what Drupal supports
1111
1111
  let dom = (0, _nodeHtmlParser.parse)(siteContent);
1112
1112
  // pull all of level 1 of hierarchy
1113
1113
  let depth;
@@ -184,6 +184,7 @@ async function webcomponentProcess(commandRun, project, port = "8000") {
184
184
  // rename gitignore to improve copy cross platform compat
185
185
  await fs.renameSync(`${project.path}/${project.name}/_github`, `${project.path}/${project.name}/.github`);
186
186
  await fs.renameSync(`${project.path}/${project.name}/_vscode`, `${project.path}/${project.name}/.vscode`);
187
+ await fs.renameSync(`${project.path}/${project.name}/_dddignore`, `${project.path}/${project.name}/.dddignore`);
187
188
  await fs.renameSync(`${project.path}/${project.name}/_editorconfig`, `${project.path}/${project.name}/.editorconfig`);
188
189
  await fs.renameSync(`${project.path}/${project.name}/_gitignore`, `${project.path}/${project.name}/.gitignore`);
189
190
  await fs.renameSync(`${project.path}/${project.name}/_nojekyll`, `${project.path}/${project.name}/.nojekyll`);
@@ -2,21 +2,80 @@
2
2
  * Copyright <%= year %> <%= author %>
3
3
  * @license Apache-2.0, see License.md for full text.
4
4
  */
5
- import { html, css, HAXCMSLitElementTheme } from "@haxtheweb/haxcms-elements/lib/core/HAXCMSLitElementTheme.js";
5
+ import { HAXCMSLitElementTheme, css, unsafeCSS, html, store, autorun, toJS } from "@haxtheweb/haxcms-elements/lib/core/HAXCMSLitElementTheme.js";
6
+ import "@haxtheweb/haxcms-elements/lib/ui-components/navigation/site-menu-button.js";
7
+ import "@haxtheweb/haxcms-elements/lib/ui-components/site/site-title.js";
8
+ import "@haxtheweb/haxcms-elements/lib/ui-components/active-item/site-active-title.js";
6
9
 
7
10
  /**
8
11
  * `<%= className %>`
9
- * `<%= className %> based on modern flex design system`
12
+ * `<%= className %> based on HAXCMS theming ecosystem`
10
13
  * `This theme is an example of extending an existing theme component`
11
14
  *
12
15
  * @microcopy - language worth noting:
13
16
  * - HAXcms - A headless content management system
14
- * - HAXCMSTheme - A super class that provides correct baseline wiring to build a new theme
17
+ * - HAXCMSLitElementTheme - A class that provides correct baseline wiring to build a new theme that HAX can use
15
18
  *
16
- * @demo demo/index.html
19
+ * @documentation - see HAX docs to learn more about theming
20
+ * - Custom theme development - https://haxtheweb.org/documentation/developers/haxsite/custom-theme-development
21
+ * - Theme Blocks - https://haxtheweb.org/documentation/developers/theme-blocks
22
+ * - DDD - https://haxtheweb.org/documentation/ddd
23
+ * - Data Store - https://haxtheweb.org/documentation/developers/haxsite/data-store
17
24
  * @element <%= customThemeName %>
18
25
  */
19
26
  class <%= className %> extends HAXCMSLitElementTheme {
27
+ /**
28
+ * Store the tag name to make it easier to obtain directly.
29
+ * @notice function name must be here for tooling to operate correctly
30
+ */
31
+ static get tag() {
32
+ return "<%= customThemeName %>";
33
+ }
34
+
35
+ // set defaults or tie into the store
36
+ constructor() {
37
+ super();
38
+ this._items = [];
39
+ this.activeId = null;
40
+ autorun(() => {
41
+ this.activeId = toJS(store.activeId);
42
+ this._items = toJS(store.manifest.items);
43
+ });
44
+ }
45
+
46
+ // properties to respond to the activeID and list of items
47
+ static get properties() {
48
+ return {
49
+ ...super.properties,
50
+ activeId: { type: String },
51
+ _items: { type: Array },
52
+ };
53
+ }
54
+
55
+ // allows for global styles to be set against the entire document
56
+ // you can also use this to cascade styles down to the theme
57
+ // but the more common reason is to influence the body or other things
58
+ // put into the global index.html context by the system itself
59
+ HAXCMSGlobalStyleSheetContent() {
60
+ return [
61
+ ...super.HAXCMSGlobalStyleSheetContent(),
62
+ css`
63
+ :root {
64
+ --my-theme-low-tone: var(--ddd-theme-default-slateMaxLight);
65
+ --my-theme-high-tone: var(--ddd-theme-default-coalyGray);
66
+ }
67
+ body {
68
+ padding: 0;
69
+ margin: 0;
70
+ background-color: var(--my-theme-low-tone);
71
+ }
72
+ body.dark-mode {
73
+ background-color: var(--my-theme-high-tone);
74
+ }
75
+ `,
76
+ ];
77
+ }
78
+
20
79
  //styles function
21
80
  static get styles() {
22
81
  return [
@@ -24,22 +83,106 @@ class <%= className %> extends HAXCMSLitElementTheme {
24
83
  css`
25
84
  :host {
26
85
  display: block;
86
+ padding: var(--ddd-spacing-10) var(--ddd-spacing-20);
87
+ max-width: 960px;
88
+ min-width: 400px;
89
+ margin: 0 auto;
90
+ border: var(--ddd-border-lg);
91
+ border-width: var(--ddd-spacing-5);
92
+ border-radius: var(--ddd-radius-lg);
93
+ background-color: light-dark(var(--my-theme-low-tone), var(--my-theme-high-tone));
94
+ color: light-dark(var(--my-theme-high-tone), var(--my-theme-low-tone));
95
+ }
96
+ .wrapper {
97
+ border-radius: var(--ddd-radius-lg);
98
+ }
99
+
100
+ site-title {
101
+ font-size: var(--ddd-font-size-l);
102
+ }
103
+
104
+ header {
105
+ display: flex;
106
+ }
107
+ ul {
108
+ margin: 0;
109
+ padding: 0;
110
+ }
111
+ ul li {
112
+ display: inline-block;
113
+ margin: 0;
114
+ padding: 0;
115
+ list-style-type: none;
116
+ vertical-align: top;
117
+ }
118
+ ul li a {
119
+ display: block;
120
+ }
121
+
122
+ button {
123
+ height: 32px;
124
+ width: 32px;
125
+ margin: 0;
126
+ padding: 0;
127
+ font-size: var(--ddd-font-size-sm);
128
+ cursor: pointer;
129
+ }
130
+
131
+ .active button {
132
+ background-color: light-dark(var(--my-theme-low-tone), var(--my-theme-high-tone));
133
+ color: light-dark(var(--my-theme-high-tone), var(--my-theme-low-tone));
134
+ font-weight: bold;
135
+ }
136
+
137
+ site-menu-button {
138
+ display: inline-block;
139
+ vertical-align: top;
27
140
  }
28
141
  `,
29
142
  ];
30
143
  }
31
144
 
32
- /**
33
- * Store the tag name to make it easier to obtain directly.
34
- * @notice function name must be here for tooling to operate correctly
35
- */
36
- static get tag() {
37
- return "<%= customThemeName %>";
38
- }
39
-
40
- constructor() {
41
- super();
145
+ render() {
146
+ return html`
147
+ <div class="wrapper">
148
+ <header>
149
+ <ul>
150
+ <li>
151
+ <site-menu-button
152
+ type="prev"
153
+ position="top"
154
+ ></site-menu-button>
155
+ </li>
156
+ ${this._items.map((item, index) => {
157
+ return html`
158
+ <li class="${item.id === this.activeId ? "active" : ""}">
159
+ <a href="${item.slug}"><button title="${item.title}">${(index+1)}</button></a>
160
+ </li>
161
+ `;
162
+ }
163
+ )}
164
+ <li>
165
+ <site-menu-button
166
+ type="next"
167
+ position="top"
168
+ ></site-menu-button>
169
+ </li>
170
+ </ul>
171
+ </header>
172
+ <main>
173
+ <site-active-title></site-active-title>
174
+ <article>
175
+ <!-- this block and names are required for HAX to edit the content of the page. contentcontainer, slot, and wrapping the slot. -->
176
+ <div id="contentcontainer"><div id="slot"><slot></slot></div></div>
177
+ </article>
178
+ </main>
179
+ <footer>
180
+ <slot name="footer"></slot>
181
+ </footer>
182
+ </div>
183
+ `;
42
184
  }
185
+
43
186
  }
44
- customElements.define(<%= className %>.tag, <%= className %>);
187
+ globalThis.customElements.define(<%= className %>.tag, <%= className %>);
45
188
  export { <%= className %> };
@@ -3,7 +3,7 @@
3
3
  * @license Apache-2.0, see License.md for full text.
4
4
  */
5
5
  import { html, css, HAXCMSLitElementTheme } from "@haxtheweb/haxcms-elements/lib/core/HAXCMSLitElementTheme.js";
6
- import { PolarisFlexTheme } from "@haxtheweb/polaris-theme/lib/polaris-flex-theme";
6
+ import { PolarisFlexTheme } from "@haxtheweb/polaris-theme/lib/polaris-flex-theme.js";
7
7
  import "@haxtheweb/haxcms-elements/lib/ui-components/blocks/site-children-block.js";
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  * @license Apache-2.0, see License.md for full text.
4
4
  */
5
5
  import { html, css, HAXCMSLitElementTheme } from "@haxtheweb/haxcms-elements/lib/core/HAXCMSLitElementTheme.js";
6
- import { PolarisFlexTheme } from "@haxtheweb/polaris-theme/lib/polaris-flex-theme";
6
+ import { PolarisFlexTheme } from "@haxtheweb/polaris-theme/lib/polaris-flex-theme.js";
7
7
  import "@haxtheweb/haxcms-elements/lib/ui-components/blocks/site-children-block.js";
8
8
 
9
9
  /**
@@ -0,0 +1,37 @@
1
+ # Directories
2
+ # (Must start with with / or \, as seen below)
3
+ /.github # Inline comments are supported
4
+ /.vscode
5
+ /.idea
6
+ /locales
7
+ \test
8
+ /dist
9
+ /build
10
+ /public # ignored by program regardless of presence in .dddignore
11
+ /node_modules # ignored by program regardless of presence in .dddignore
12
+
13
+ # Files
14
+ # (Must include filename and extension, as seen below)
15
+ LICENSE
16
+ .dddignore
17
+ .editorconfig
18
+ .gitignore
19
+ .nojekyll
20
+ .npmignore
21
+ .surgeignore
22
+ rollup.config.js
23
+
24
+ # File extension
25
+ # (Must start with *, as seen below)
26
+ *.html
27
+ *.md
28
+ *.yml
29
+ *.json
30
+ *.toml
31
+ *.mjs
32
+ *.cjs
33
+ *.png
34
+ *.ico
35
+ *.svg
36
+ *.jpg
37
+ *.jpeg
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haxtheweb/create",
3
- "version": "10.0.4",
3
+ "version": "10.0.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@clack/core": "0.3.4",
47
47
  "@clack/prompts": "0.7.0",
48
- "@haxtheweb/haxcms-nodejs": "^10.0.3",
48
+ "@haxtheweb/haxcms-nodejs": "^10.0.4",
49
49
  "@haxtheweb/open-apis": "^10.0.1",
50
50
  "commander": "12.1.0",
51
51
  "ejs": "3.1.10",