@stackoverflow/stacks 1.10.3 → 1.10.4

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.
@@ -198,6 +198,10 @@ p {
198
198
  overflow-wrap: normal !important;
199
199
  }
200
200
 
201
+ .ow-anywhere {
202
+ overflow-wrap: anywhere !important;
203
+ }
204
+
201
205
  .ow-break-word {
202
206
  overflow-wrap: break-word !important;
203
207
  }
@@ -0,0 +1,27 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ describe("expandable", () => {
6
+ runComponentTests({
7
+ type: "a11y",
8
+ baseClass: "s-expandable",
9
+ modifiers: {
10
+ global: ["is-expanded"],
11
+ },
12
+ children: {
13
+ default: `
14
+ <div class="s-expandable--content">
15
+ <p class="mb8">Expandable: Lorem ipsum dolor sit amet, ex iudicabit necessitatibus usu, cetero laboramus concludaturque mel no, facilisis posidonium cu cum. Pro ex senserit dissentiunt, imperdiet intellegam at sed, ex pri dicit eruditi convenire. Est harum movet gubergren ei, errem dictas evertitur ea sit, at mei oratio eligendi. Ad vis legere possit, vis ne ipsum democritum appellantur. Nullam ancillae iudicabit his ad.</p>
16
+ </div>
17
+ `,
18
+ },
19
+ template: ({ component, testid }) => html`
20
+ <div class="ws2 p8" data-testid="${testid}">
21
+ <div><p>Before expandable content</p></div>
22
+ ${component}
23
+ <div><p>After expandable content</p></div>
24
+ </div>
25
+ `,
26
+ });
27
+ });
@@ -0,0 +1,27 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ describe("expandable", () => {
6
+ runComponentTests({
7
+ type: "visual",
8
+ baseClass: "s-expandable",
9
+ modifiers: {
10
+ global: ["is-expanded"],
11
+ },
12
+ children: {
13
+ default: `
14
+ <div class="s-expandable--content">
15
+ <p class="mb8">Expandable: Lorem ipsum dolor sit amet, ex iudicabit necessitatibus usu, cetero laboramus concludaturque mel no, facilisis posidonium cu cum. Pro ex senserit dissentiunt, imperdiet intellegam at sed, ex pri dicit eruditi convenire. Est harum movet gubergren ei, errem dictas evertitur ea sit, at mei oratio eligendi. Ad vis legere possit, vis ne ipsum democritum appellantur. Nullam ancillae iudicabit his ad.</p>
16
+ </div>
17
+ `,
18
+ },
19
+ template: ({ component, testid }) => html`
20
+ <div class="ws2 p8" data-testid="${testid}">
21
+ <div><p>Before expandable content</p></div>
22
+ ${component}
23
+ <div><p>After expandable content</p></div>
24
+ </div>
25
+ `,
26
+ });
27
+ });
@@ -0,0 +1,55 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import "../../index";
3
+
4
+ const getChild = (child?: string): string => {
5
+ return `
6
+ <div class="s-link-preview--header">
7
+ <div class="s-link-preview--icon">👋</div>
8
+ <div>
9
+ <a href="#" class="s-link-preview--title">
10
+ Using hooks for a simple fetch request and breaking the rules of hooks, unsure how?
11
+ </a>
12
+ <div class="s-link-preview--details">
13
+ Issue submitted by Ricky Otero on <relative-time datetime="2019-08-12T04:05:22Z" title="Aug 12, 2019, 12:05 AM EDT">Aug 12, 2019</relative-time> • <strong>RESOLVED</strong>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ ${
18
+ child
19
+ ? child
20
+ : `
21
+ <div class="s-link-preview--body">
22
+ <p>I'm trying to create a simple fetch with hooks from an AWS database. At the moment it errors out and the only reason I can see is because it breaks the rules of hooks but I'm not sure how. It's at the top level of this functional component and it's not called inside an event handler.</p>
23
+ <p>The result of this call (an array of user data), needs to be exported as a function and called in another file.</p>
24
+ <p>If anyone can spot something I have missed and can highlighted how I'm breaking the rules of hooks I'd be grateful!</p>
25
+ <p>Thanks!</p>
26
+ </div>
27
+ `
28
+ }
29
+ <div class="s-link-preview--footer">
30
+ <a href="#" class="s-link-preview--url">https://stackoverflow.atlassian.net/projects/SREREQ/queues/custom/1</a>
31
+ <a href="#" class="s-link-preview--misc">Privacy notice</a>
32
+ </div>
33
+ `;
34
+ };
35
+ describe("link preview", () => {
36
+ runComponentTests({
37
+ type: "a11y",
38
+ baseClass: "s-link-preview",
39
+ children: {
40
+ default: getChild(),
41
+ code: getChild(`
42
+ <div class="s-link-preview--code">
43
+ <pre class="language-js s-code-block" tabindex="0"><code class="language-js s-code-block"><span class="hljs-meta">'use strict'</span>;</code></pre>
44
+ </div>
45
+ `),
46
+ },
47
+ // TODO: Most of those skipped tests should be fixed by the new Stacks 2.0 palette
48
+ skippedTestids: [
49
+ "s-link-preview-dark",
50
+ "s-link-preview-dark-code",
51
+ "s-link-preview-light",
52
+ "s-link-preview-light-code",
53
+ ],
54
+ });
55
+ });
@@ -0,0 +1,52 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ const getChild = (child?: string): string => {
6
+ return `
7
+ <div class="s-link-preview--header">
8
+ <div class="s-link-preview--icon">👋</div>
9
+ <div>
10
+ <a href="#" class="s-link-preview--title">
11
+ Using hooks for a simple fetch request and breaking the rules of hooks, unsure how?
12
+ </a>
13
+ <div class="s-link-preview--details">
14
+ Issue submitted by Ricky Otero on <relative-time datetime="2019-08-12T04:05:22Z" title="Aug 12, 2019, 12:05 AM EDT">Aug 12, 2019</relative-time> • <strong>RESOLVED</strong>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ ${
19
+ child
20
+ ? child
21
+ : `
22
+ <div class="s-link-preview--body">
23
+ <p>I'm trying to create a simple fetch with hooks from an AWS database. At the moment it errors out and the only reason I can see is because it breaks the rules of hooks but I'm not sure how. It's at the top level of this functional component and it's not called inside an event handler.</p>
24
+ <p>The result of this call (an array of user data), needs to be exported as a function and called in another file.</p>
25
+ <p>If anyone can spot something I have missed and can highlighted how I'm breaking the rules of hooks I'd be grateful!</p>
26
+ <p>Thanks!</p>
27
+ </div>
28
+ `
29
+ }
30
+ <div class="s-link-preview--footer">
31
+ <a href="#" class="s-link-preview--url">https://stackoverflow.atlassian.net/projects/SREREQ/queues/custom/1</a>
32
+ <a href="#" class="s-link-preview--misc">Privacy notice</a>
33
+ </div>
34
+ `;
35
+ };
36
+ describe("link preview", () => {
37
+ runComponentTests({
38
+ type: "visual",
39
+ baseClass: "s-link-preview",
40
+ children: {
41
+ default: getChild(),
42
+ code: getChild(`
43
+ <div class="s-link-preview--code">
44
+ <pre class="language-js s-code-block" tabindex="0"><code class="language-js s-code-block"><span class="hljs-meta">'use strict'</span>;</code></pre>
45
+ </div>
46
+ `),
47
+ },
48
+ template: ({ component, testid }) => html`
49
+ <div class="ws8 p8" data-testid="${testid}">${component}</div>
50
+ `,
51
+ });
52
+ });
@@ -102,6 +102,7 @@
102
102
  background-repeat: no-repeat;
103
103
  border-radius: 1000px;
104
104
  cursor: pointer;
105
+ flex-shrink: 0;
105
106
  height: var(--su-static24);
106
107
  margin: 0; // guard against production adding 5px of margin to these
107
108
  transition: background-position 0.2s ease;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/StackExchange/Stacks.git"
7
7
  },
8
- "version": "1.10.3",
8
+ "version": "1.10.4",
9
9
  "files": [
10
10
  "dist",
11
11
  "lib"
@@ -50,21 +50,21 @@
50
50
  "@stackoverflow/stacks-icons": "^5.5.0",
51
51
  "@testing-library/dom": "^9.3.1",
52
52
  "@testing-library/user-event": "^14.4.3",
53
- "@typescript-eslint/eslint-plugin": "^6.4.0",
54
- "@typescript-eslint/parser": "^6.4.0",
53
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
54
+ "@typescript-eslint/parser": "^6.4.1",
55
55
  "@web/dev-server-esbuild": "^0.4.1",
56
56
  "@web/dev-server-rollup": "^0.5.2",
57
57
  "@web/test-runner": "^0.17.0",
58
58
  "@web/test-runner-playwright": "^0.10.1",
59
59
  "@web/test-runner-visual-regression": "^0.8.2",
60
60
  "apca-w3": "^0.1.9",
61
- "concurrently": "^8.2.0",
61
+ "concurrently": "^8.2.1",
62
62
  "css-loader": "^6.8.1",
63
63
  "cssnano": "^6.0.1",
64
64
  "docsearch.js": "^2.6.3",
65
65
  "eleventy-plugin-highlightjs": "^1.1.0",
66
66
  "eleventy-plugin-nesting-toc": "^1.3.0",
67
- "eslint": "^8.47.0",
67
+ "eslint": "^8.48.0",
68
68
  "eslint-config-prettier": "^9.0.0",
69
69
  "eslint-plugin-no-unsanitized": "^4.0.2",
70
70
  "jquery": "^3.7.0",
@@ -81,7 +81,7 @@
81
81
  "stylelint-config-standard": "^34.0.0",
82
82
  "terser-webpack-plugin": "^5.3.9",
83
83
  "ts-loader": "^9.4.4",
84
- "typescript": "^5.1.6",
84
+ "typescript": "^5.2.2",
85
85
  "webpack": "^5.88.2",
86
86
  "webpack-cli": "^5.1.4",
87
87
  "webpack-merge": "^5.9.0"