@opencraft/frontend-plugin-sandbox 1.2.0-alpha.0 → 1.2.0-alpha.2
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.
- package/.github/workflows/npm-package-for-pr.yaml +7 -4
- package/dist/components/DropDownToggler.js +1 -1
- package/dist/components/DropDownToggler.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +41 -42
- package/pnpm-workspace.yaml +13 -0
- package/src/components/DropDownToggler.tsx +1 -1
|
@@ -10,17 +10,20 @@ jobs:
|
|
|
10
10
|
steps:
|
|
11
11
|
- name: Checkout repository
|
|
12
12
|
uses: actions/checkout@v6
|
|
13
|
+
- name: Set up pnpm
|
|
14
|
+
uses: pnpm/action-setup@v6
|
|
15
|
+
with:
|
|
16
|
+
version: 11
|
|
13
17
|
- name: Setup Node.js
|
|
14
18
|
uses: actions/setup-node@v6
|
|
15
19
|
with:
|
|
16
20
|
node-version: '24'
|
|
17
|
-
cache: 'npm'
|
|
18
21
|
- name: Install dependencies
|
|
19
|
-
run:
|
|
22
|
+
run: pnpm install --frozen-lockfile
|
|
20
23
|
- name: Build
|
|
21
|
-
run:
|
|
24
|
+
run: pnpm run build
|
|
22
25
|
- name: Pack package
|
|
23
|
-
run:
|
|
26
|
+
run: pnpm pack
|
|
24
27
|
- name: Upload package
|
|
25
28
|
id: upload-package
|
|
26
29
|
uses: actions/upload-artifact@v7
|
|
@@ -11,7 +11,7 @@ export const DropDownToggler = ({
|
|
|
11
11
|
return /*#__PURE__*/React.createElement(Avatar, {
|
|
12
12
|
size: "1.5em",
|
|
13
13
|
src: avatar,
|
|
14
|
-
alt: authenticatedUser
|
|
14
|
+
alt: authenticatedUser?.username || 'Account'
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
DropDownToggler.propTypes = DesktopUserMenuTogglePropTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDownToggler.js","names":["React","useContext","Avatar","DesktopUserMenuTogglePropTypes","AppContext","DropDownToggler","avatar","authenticatedUser","createElement","size","src","alt","username","propTypes"],"sources":["../../src/components/DropDownToggler.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport Avatar from '@edx/frontend-component-header/dist/Avatar';\nimport { DesktopUserMenuTogglePropTypes } from '@edx/frontend-component-header/dist/desktop-header/DesktopUserMenuToggle';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nexport const DropDownToggler = ({ avatar }) => {\n const { authenticatedUser } = useContext(AppContext);\n return (\n <Avatar size=\"1.5em\" src={avatar} alt={authenticatedUser
|
|
1
|
+
{"version":3,"file":"DropDownToggler.js","names":["React","useContext","Avatar","DesktopUserMenuTogglePropTypes","AppContext","DropDownToggler","avatar","authenticatedUser","createElement","size","src","alt","username","propTypes"],"sources":["../../src/components/DropDownToggler.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport Avatar from '@edx/frontend-component-header/dist/Avatar';\nimport { DesktopUserMenuTogglePropTypes } from '@edx/frontend-component-header/dist/desktop-header/DesktopUserMenuToggle';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nexport const DropDownToggler = ({ avatar }) => {\n const { authenticatedUser } = useContext(AppContext);\n return (\n <Avatar size=\"1.5em\" src={avatar} alt={authenticatedUser?.username || 'Account'} />\n );\n};\n\nDropDownToggler.propTypes = DesktopUserMenuTogglePropTypes;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,MAAM,MAAM,4CAA4C;AAC/D,SAASC,8BAA8B,QAAQ,0EAA0E;AACzH,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAC7C,MAAM;IAAEC;EAAkB,CAAC,GAAGN,UAAU,CAACG,UAAU,CAAC;EACpD,oBACEJ,KAAA,CAAAQ,aAAA,CAACN,MAAM;IAACO,IAAI,EAAC,OAAO;IAACC,GAAG,EAAEJ,MAAO;IAACK,GAAG,EAAEJ,iBAAiB,EAAEK,QAAQ,IAAI;EAAU,CAAE,CAAC;AAEvF,CAAC;AAEDP,eAAe,CAACQ,SAAS,GAAGV,8BAA8B","ignoreList":[]}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DIRECT_PLUGIN","PLUGIN_OPERATIONS","MenuWrapper","SandboxFooter","DropDownToggler","CatalogBanner","slotSettings","keepDefault","plugins","op","Insert","widget","id","type","RenderWidget","desktop_user_menu_slot","Wrap","widgetId","wrapper","mobile_user_menu_slot","footer_slot","Hide"],"sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["DIRECT_PLUGIN","PLUGIN_OPERATIONS","MenuWrapper","SandboxFooter","DropDownToggler","CatalogBanner","slotSettings","keepDefault","plugins","op","Insert","widget","id","type","RenderWidget","desktop_user_menu_slot","Wrap","widgetId","wrapper","mobile_user_menu_slot","footer_slot","Hide"],"sources":["../src/index.ts"],"sourcesContent":["import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';\nimport { MenuWrapper } from './components/MenuWrapper';\nimport { SandboxFooter } from './components/SandboxFooter';\nimport { DropDownToggler } from './components/DropDownToggler';\nimport { CatalogBanner } from './components/CatalogBanner';\n\nexport {\n MenuWrapper, SandboxFooter, DropDownToggler, CatalogBanner,\n};\n// Example slot settings you can use in your deployment. You may be able to import these\n// for quick development usage.\nexport const slotSettings = {\n 'org.openedx.frontend.layout.header_desktop_user_menu_toggle.v1': {\n keepDefault: false,\n plugins: [\n {\n op: PLUGIN_OPERATIONS.Insert,\n widget: {\n id: 'custom_desktop_toggle',\n type: DIRECT_PLUGIN,\n RenderWidget: DropDownToggler,\n },\n },\n ],\n },\n desktop_user_menu_slot: {\n keepDefault: true,\n plugins: [\n {\n op: PLUGIN_OPERATIONS.Wrap,\n widgetId: 'default_contents',\n wrapper: MenuWrapper,\n },\n ],\n },\n mobile_user_menu_slot: {\n keepDefault: true,\n plugins: [\n {\n op: PLUGIN_OPERATIONS.Wrap,\n widgetId: 'default_contents',\n wrapper: MenuWrapper,\n },\n ],\n },\n footer_slot: {\n plugins: [\n {\n op: PLUGIN_OPERATIONS.Hide,\n widgetId: 'default_contents',\n },\n {\n op: PLUGIN_OPERATIONS.Insert,\n widget: {\n id: 'custom_footer',\n type: DIRECT_PLUGIN,\n RenderWidget: SandboxFooter,\n },\n },\n ],\n },\n 'org.openedx.frontend.catalog.home_page.banner': {\n plugins: [\n {\n op: PLUGIN_OPERATIONS.Hide,\n widgetId: 'default_contents',\n },\n {\n op: PLUGIN_OPERATIONS.Insert,\n widget: {\n id: 'custom_catalog_banner',\n type: DIRECT_PLUGIN,\n RenderWidget: CatalogBanner,\n },\n },\n ],\n },\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,iBAAiB,QAAQ,oCAAoC;AACrF,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,aAAa,QAAQ,4BAA4B;AAE1D,SACEH,WAAW,EAAEC,aAAa,EAAEC,eAAe,EAAEC,aAAa;AAE5D;AACA;AACA,OAAO,MAAMC,YAAY,GAAG;EAC1B,gEAAgE,EAAE;IAChEC,WAAW,EAAE,KAAK;IAClBC,OAAO,EAAE,CACP;MACEC,EAAE,EAAER,iBAAiB,CAACS,MAAM;MAC5BC,MAAM,EAAE;QACNC,EAAE,EAAE,uBAAuB;QAC3BC,IAAI,EAAEb,aAAa;QACnBc,YAAY,EAAEV;MAChB;IACF,CAAC;EAEL,CAAC;EACDW,sBAAsB,EAAE;IACtBR,WAAW,EAAE,IAAI;IACjBC,OAAO,EAAE,CACP;MACEC,EAAE,EAAER,iBAAiB,CAACe,IAAI;MAC1BC,QAAQ,EAAE,kBAAkB;MAC5BC,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
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
2
|
+
"name": "@opencraft/frontend-plugin-sandbox",
|
|
3
|
+
"version": "1.2.0-alpha.2",
|
|
4
|
+
"description": "Plugin for custom headers and footers in OpenCraft's sandboxes",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/open-craft/frontend-plugin-sandbox.git"
|
|
8
|
+
},
|
|
9
|
+
"browserslist": [
|
|
10
|
+
"extends @edx/browserslist-config"
|
|
11
|
+
],
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"author": "OpenCraft",
|
|
14
|
+
"license": "AGPL-3.0",
|
|
15
|
+
"homepage": "https://github.com/open-craft/frontend-plugin-sandbox#readme",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/open-craft/frontend-plugin-sandbox/issues"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@edx/frontend-component-header": ">=6.6.0",
|
|
24
|
+
"@edx/frontend-platform": ">=8.0.0",
|
|
25
|
+
"@openedx/frontend-plugin-framework": ">=1.2.1",
|
|
26
|
+
"@openedx/paragon": ">=23.14.2",
|
|
27
|
+
"@types/react": "^18.0.0",
|
|
28
|
+
"classnames": "*",
|
|
29
|
+
"react": "^18.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@edx/browserslist-config": ">=1.1.1",
|
|
33
|
+
"@openedx/frontend-build": ">=14.6.6",
|
|
34
|
+
"typescript": "^5.2.0"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "fedx-scripts babel -x .ts,.tsx src --out-dir dist --source-maps --ignore **/*.test.jsx,**/__mocks__,**/__snapshots__,**/setupTest.js --copy-files",
|
|
38
|
+
"lint": "fedx-scripts eslint --ext .ts --ext .tsx src/",
|
|
39
|
+
"lint:fix": "fedx-scripts eslint --fix --ext .ts --ext .tsx src/",
|
|
40
|
+
"test": "fedx-scripts jest --coverage --passWithNoTests"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
allowBuilds:
|
|
2
|
+
'@bundled-es-modules/glob': false
|
|
3
|
+
'@parcel/watcher': false
|
|
4
|
+
core-js: false
|
|
5
|
+
core-js-pure: false
|
|
6
|
+
sharp: false
|
|
7
|
+
style-dictionary: false
|
|
8
|
+
unrs-resolver: false
|
|
9
|
+
blockExoticSubdeps: true
|
|
10
|
+
# Supply chain security configuration. See https://pnpm.io/supply-chain-security for more information.
|
|
11
|
+
minimumReleaseAge: 4320 # 3 days
|
|
12
|
+
trustPolicy: no-downgrade
|
|
13
|
+
trustPolicyIgnoreAfter: 43200 # 30 days
|
|
@@ -6,7 +6,7 @@ import { AppContext } from '@edx/frontend-platform/react';
|
|
|
6
6
|
export const DropDownToggler = ({ avatar }) => {
|
|
7
7
|
const { authenticatedUser } = useContext(AppContext);
|
|
8
8
|
return (
|
|
9
|
-
<Avatar size="1.5em" src={avatar} alt={authenticatedUser
|
|
9
|
+
<Avatar size="1.5em" src={avatar} alt={authenticatedUser?.username || 'Account'} />
|
|
10
10
|
);
|
|
11
11
|
};
|
|
12
12
|
|