Skip to content

Commit

Permalink
Merge pull request #94 from spartez/APJ-2908-fix-vulnerabilities
Browse files Browse the repository at this point in the history
APJ-2908 upgrade atlaskit tokens
  • Loading branch information
abilicz authored Nov 29, 2023
2 parents fef35d4 + 12a817a commit 1085207
Show file tree
Hide file tree
Showing 22 changed files with 15,076 additions and 10,055 deletions.
43 changes: 33 additions & 10 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import '@atlaskit/css-reset/dist/bundle.css';
import '@atlaskit/tokens/css/atlassian-dark.css'
import '@atlaskit/tokens/css/atlassian-light.css'
import '@atlaskit/tokens/css/atlassian-spacing.css'
import '@atlaskit/tokens/css/atlassian-typography.css'
import { getGlobalTheme, setGlobalTheme } from '@atlaskit/tokens';
import './style.css';

import { storiesOf, configure } from '@storybook/vue';
Expand Down Expand Up @@ -30,10 +26,10 @@ const registerStory = (filename) => {
.addParameters({
rootAttributes: [{
root: 'html',
attribute: 'data-theme',
attribute: 'theme',
defaultState: {
name: "Light",
value: null
value: "light"
},
states: [
{
Expand All @@ -42,13 +38,14 @@ const registerStory = (filename) => {
}
]
}]
}).addDecorator(withRootAttribute)
})
.addDecorator(withRootAttribute)
.addParameters({
rootAttribute: {
attribute: 'data-theme',
attribute: 'theme',
defaultState: {
name: "Light",
value: null
value: "light"
},
states: [
{
Expand All @@ -61,6 +58,32 @@ const registerStory = (filename) => {
.add(name, () => ({
name: 'StoryWrapper',
components: component.components,
data() {
return {
observer: null
}
},
mounted() {
const targetNode = document.querySelector("html");
const config = { attributes: true };
const callback = function (mutationsList) {
for (let mutation of mutationsList) {
const currentTheme = mutation.target.getAttribute("theme");
if (mutation.type === 'attributes' && currentTheme && currentTheme !== getGlobalTheme().colorMode) {
void setGlobalTheme({ colorMode: mutation.target.getAttribute('theme') })
}
}
};
if (!this.observer) {
this.observer = new MutationObserver(callback);
this.observer.observe(targetNode, config);
}
},
beforeDestroy() {
if (this.observer) {
this.observer.disconnect();
}
},
render(h) {
return h(component, { style: { padding: '20px' } });
}
Expand Down
10 changes: 10 additions & 0 deletions .storybook/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ html,
body,
#app {
height: 100%;
background-color: var(--ds-surface, #fff);
color: var(--ds-text, #172B4D);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 1.42857142857143;
-ms-overflow-style: -ms-autohiding-scrollbar;
-webkit-text-decoration-skip: ink;
text-decoration-skip-ink: auto;
}


Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-env node */
module.exports = {
plugins: [
"@atlaskit/tokens/babel-plugin"
],
presets: [
[
'@babel/preset-env',
Expand Down
Binary file removed docs/favicon.ico
Binary file not shown.
74 changes: 0 additions & 74 deletions docs/iframe.html

This file was deleted.

19 changes: 0 additions & 19 deletions docs/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.00d2a1d12d30d5ba79bb.bundle.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/main.cefdfccade8f06570bba.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.cefdfccade8f06570bba.bundle.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.cefdfccade8f06570bba.bundle.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions docs/runtime~main.cefdfccade8f06570bba.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/runtime~main.cefdfccade8f06570bba.bundle.js.map

This file was deleted.

1 change: 0 additions & 1 deletion docs/runtime~main.f6145a39c2e3eb089a89.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/sb_dll/storybook_ui-manifest.json

This file was deleted.

113 changes: 0 additions & 113 deletions docs/sb_dll/storybook_ui_dll.LICENCE

This file was deleted.

2 changes: 0 additions & 2 deletions docs/sb_dll/storybook_ui_dll.js

This file was deleted.

112 changes: 0 additions & 112 deletions docs/vendors~main.28c73344df1b9891621a.bundle.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/vendors~main.cefdfccade8f06570bba.bundle.js

This file was deleted.

Loading

0 comments on commit 1085207

Please sign in to comment.