@stoplight/elements 9.0.10 → 9.0.12-beta-0.1

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.
Files changed (63) hide show
  1. package/.storybook/main.js +6 -0
  2. package/.storybook/manager.js +1 -0
  3. package/.storybook/preview.jsx +3 -0
  4. package/jest.config.js +7 -0
  5. package/package.json +76 -16
  6. package/src/__fixtures__/api-descriptions/Instagram.ts +1859 -0
  7. package/src/__fixtures__/api-descriptions/badgesForSchema.ts +36 -0
  8. package/src/__fixtures__/api-descriptions/simpleApiWithInternalOperations.ts +253 -0
  9. package/src/__fixtures__/api-descriptions/simpleApiWithoutDescription.ts +243 -0
  10. package/src/__fixtures__/api-descriptions/todosApiBundled.ts +430 -0
  11. package/src/__fixtures__/api-descriptions/zoomApiYaml.ts +6083 -0
  12. package/src/components/API/APIWithResponsiveSidebarLayout.tsx +125 -0
  13. package/src/components/API/APIWithSidebarLayout.tsx +158 -0
  14. package/src/components/API/APIWithStackedLayout.tsx +286 -0
  15. package/src/components/API/__tests__/utils.test.ts +1323 -0
  16. package/src/components/API/utils.ts +206 -0
  17. package/src/containers/API.spec.tsx +122 -0
  18. package/src/containers/API.stories.tsx +117 -0
  19. package/src/containers/API.tsx +277 -0
  20. package/src/containers/story-helper.tsx +53 -0
  21. package/src/hooks/useExportDocumentProps.spec.tsx +68 -0
  22. package/src/hooks/useExportDocumentProps.tsx +48 -0
  23. package/src/styles.css +1 -0
  24. package/src/utils/oas/__tests__/oas.spec.ts +411 -0
  25. package/src/utils/oas/index.ts +192 -0
  26. package/src/utils/oas/oas2.ts +31 -0
  27. package/src/utils/oas/oas3.ts +54 -0
  28. package/src/utils/oas/types.ts +34 -0
  29. package/src/web-components/__stories__/Api.stories.tsx +63 -0
  30. package/src/web-components/components.ts +26 -0
  31. package/src/web-components/index.ts +3 -0
  32. package/tsconfig.build.json +18 -0
  33. package/tsconfig.json +7 -0
  34. package/web-components.config.js +1 -0
  35. package/__fixtures__/api-descriptions/Instagram.d.ts +0 -1547
  36. package/__fixtures__/api-descriptions/badgesForSchema.d.ts +0 -1
  37. package/__fixtures__/api-descriptions/simpleApiWithInternalOperations.d.ts +0 -224
  38. package/__fixtures__/api-descriptions/simpleApiWithoutDescription.d.ts +0 -212
  39. package/__fixtures__/api-descriptions/todosApiBundled.d.ts +0 -1
  40. package/__fixtures__/api-descriptions/zoomApiYaml.d.ts +0 -1
  41. package/components/API/APIWithResponsiveSidebarLayout.d.ts +0 -25
  42. package/components/API/APIWithSidebarLayout.d.ts +0 -32
  43. package/components/API/APIWithStackedLayout.d.ts +0 -29
  44. package/components/API/utils.d.ts +0 -20
  45. package/containers/API.d.ts +0 -30
  46. package/containers/API.spec.d.ts +0 -1
  47. package/containers/API.stories.d.ts +0 -58
  48. package/containers/story-helper.d.ts +0 -2
  49. package/hooks/useExportDocumentProps.d.ts +0 -11
  50. package/hooks/useExportDocumentProps.spec.d.ts +0 -1
  51. package/index.esm.js +0 -657
  52. package/index.js +0 -681
  53. package/index.mjs +0 -657
  54. package/styles.min.css +0 -1
  55. package/utils/oas/index.d.ts +0 -3
  56. package/utils/oas/oas2.d.ts +0 -2
  57. package/utils/oas/oas3.d.ts +0 -2
  58. package/utils/oas/types.d.ts +0 -33
  59. package/web-components/components.d.ts +0 -1
  60. package/web-components/index.d.ts +0 -1
  61. package/web-components.min.js +0 -2
  62. package/web-components.min.js.LICENSE.txt +0 -176
  63. /package/{index.d.ts → src/index.ts} +0 -0
@@ -0,0 +1,6 @@
1
+ import { join } from 'path';
2
+ import config from '../../../.storybook/main';
3
+
4
+ config.stories = [join(__dirname, '../**/*.stories.{js,jsx,ts,tsx}')];
5
+
6
+ export default {...config};
@@ -0,0 +1 @@
1
+ require("../../../.storybook/manager");
@@ -0,0 +1,3 @@
1
+ export * from '../../../.storybook/preview';
2
+
3
+ import '../src/styles.css';
package/jest.config.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ ...require('../../jest.config'),
3
+ reporters: [
4
+ 'default',
5
+ ['jest-junit', { suiteName: 'elements', outputFile: '<rootDir>/../../test-results/elements/results.xml' }],
6
+ ],
7
+ };
package/package.json CHANGED
@@ -1,32 +1,69 @@
1
1
  {
2
2
  "name": "@stoplight/elements",
3
- "version": "9.0.10",
3
+ "version": "9.0.12-beta-0.1",
4
4
  "description": "UI components for composing beautiful developer documentation.",
5
5
  "keywords": [],
6
- "main": "./index.js",
7
6
  "sideEffects": [
8
7
  "web-components.min.js",
9
8
  "src/web-components/**",
10
9
  "**/*.css"
11
10
  ],
12
- "files": [
13
- "**/*"
14
- ],
11
+ "homepage": "https://github.com/stoplightio/elements",
12
+ "bugs": "https://github.com/stoplightio/elements/issues",
15
13
  "author": "Stoplight <support@stoplight.io>",
16
14
  "repository": {
17
15
  "type": "git",
18
16
  "url": "https://github.com/stoplightio/elements"
19
17
  },
20
18
  "license": "Apache-2.0",
19
+ "type": "commonjs",
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.esm.js",
22
+ "exports": {
23
+ "./styles.min.css": "./styles.min.css",
24
+ "./web-components.min.js": "./web-components.min.js",
25
+ ".": {
26
+ "types": "./index.d.ts",
27
+ "require": "./dist/index.js",
28
+ "import": "./dist/index.mjs"
29
+ }
30
+ },
31
+ "files": [
32
+ "**/*"
33
+ ],
21
34
  "engines": {
22
35
  "node": ">=16"
23
36
  },
37
+ "scripts": {
38
+ "build": "yarn build.react && yarn build.webcomponents",
39
+ "postbuild": "yarn build.styles",
40
+ "build.react": "sl-scripts bundle",
41
+ "build.styles": "postcss src/styles.css -o dist/styles.min.css",
42
+ "build.webcomponents": "node --max-old-space-size=4096 ./../../node_modules/webpack/bin/webpack.js -c ./web-components.config.js",
43
+ "build.docs": "storybook build -c .storybook -o dist-storybook",
44
+ "commit": "git-cz",
45
+ "release": "sl-scripts release",
46
+ "release.docs": "sl-scripts release:docs",
47
+ "release.dryRun": "sl-scripts release --dry-run --debug",
48
+ "storybook": "storybook dev -p 9001",
49
+ "test": "jest",
50
+ "test.prod": "yarn test --coverage --maxWorkers=2",
51
+ "test.update": "yarn test --updateSnapshot",
52
+ "test.watch": "yarn test --watch",
53
+ "test.packaging": "node --input-type=commonjs -e \"require('./dist/index.js')\" && node --input-type=module -e \"import './dist/index.mjs'\"",
54
+ "type-check": "tsc --noEmit"
55
+ },
24
56
  "peerDependencies": {
25
57
  "react": ">=16.8",
26
58
  "react-dom": ">=16.8"
27
59
  },
60
+ "rollup": {
61
+ "bundleDeps": [
62
+ "@fortawesome/free-solid-svg-icons"
63
+ ]
64
+ },
28
65
  "dependencies": {
29
- "@stoplight/elements-core": "~9.0.10",
66
+ "@stoplight/elements-core": "~9.0.12-beta-0.1",
30
67
  "@stoplight/http-spec": "^7.1.0",
31
68
  "@stoplight/json": "^3.18.1",
32
69
  "@stoplight/mosaic": "^1.53.5",
@@ -38,15 +75,38 @@
38
75
  "react-query": "^3.34.19",
39
76
  "react-router-dom": "^6.28.0"
40
77
  },
41
- "type": "commonjs",
42
- "exports": {
43
- "./styles.min.css": "./styles.min.css",
44
- "./web-components.min.js": "./web-components.min.js",
45
- ".": {
46
- "require": "./index.js",
47
- "import": "./index.mjs"
48
- }
78
+ "devDependencies": {
79
+ "@fortawesome/free-solid-svg-icons": "^6.1.1",
80
+ "@stoplight/scripts": "10.0.0",
81
+ "@testing-library/dom": "^7.26.5",
82
+ "@testing-library/jest-dom": "^5.16.4",
83
+ "@testing-library/react": "^11.1.1",
84
+ "@testing-library/react-hooks": "^8.0.1",
85
+ "@testing-library/user-event": "^12.2.0",
86
+ "@types/enzyme": "3.x.x",
87
+ "@types/enzyme-adapter-react-16": "1.x.x",
88
+ "@types/file-saver": "^2.0.5",
89
+ "@types/json-schema": "^7.0.11",
90
+ "@types/lodash": "^4.14.181",
91
+ "@types/react": "16.9.56",
92
+ "@types/react-dom": "16.9.12",
93
+ "@types/react-router-dom": "^5.3.3",
94
+ "enzyme": "3.x.x",
95
+ "enzyme-adapter-react-16": "1.x.x",
96
+ "enzyme-to-json": "3.x.x",
97
+ "jest-fetch-mock": "^3.0.3",
98
+ "react": "16.14.0",
99
+ "react-dom": "16.14.0",
100
+ "react-test-renderer": "^16.8.0",
101
+ "resolve-url-loader": "^5.0.0",
102
+ "storybook": "next",
103
+ "style-loader": "^3.3.3",
104
+ "ts-loader": "^9.2.8"
105
+ },
106
+ "publishConfig": {
107
+ "directory": "dist"
49
108
  },
50
- "typings": "index.d.ts",
51
- "module": "./index.esm.js"
109
+ "release": {
110
+ "extends": "@stoplight/scripts/release"
111
+ }
52
112
  }