diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..35e40b5 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,38 @@ +name: CI +on: + pull_request: + push: + branches: + - main + +jobs: + prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "yarn" + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Run code formatting check + run: yarn run fmt:check + playwright-tests: + name: Playwright tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "yarn" + - name: Install dependencies + run: | + yarn add bos-workspace + npx playwright install-deps + npx playwright install + - name: Run tests + run: | + npx playwright test diff --git a/.gitignore b/.gitignore index 1343b9e..c108242 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules /build /dist + +test-results \ No newline at end of file diff --git a/package.json b/package.json index 26273b7..0cb681f 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,17 @@ "author": "nearbuilders", "license": "MIT", "scripts": { + "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", + "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", "bw": "bos-workspace", "dev": "bw dev", "dev:testnet": "bw dev -n testnet", "build": "bw build", - "build:testnet": "bw build -n testnet" + "build:testnet": "bw build -n testnet", + "test": "npx playwright test" }, "devDependencies": { + "@playwright/test": "^1.43.1", "bos-workspace": "^1.0.0-alpha", "prettier": "^2.8.8" } diff --git a/playwright-tests/README.md b/playwright-tests/README.md new file mode 100644 index 0000000..cd123ff --- /dev/null +++ b/playwright-tests/README.md @@ -0,0 +1,64 @@ +# Testing Guide + +This project uses [playwright](https://playwright.dev/) for end-to-end testing. Please become familiar with this documentation. + +## Writing tests + +Tests should be written for each change or addition to the codebase. +If a new feature is introduced, tests should be written to validate its functionality. If a bug is fixed, tests should be written to prevent regression. Writing tests not only safeguards against future breaks by other developers but also accelerates development by minimizing manual coding and browser interactions. + +When writing tests, remember to: + +- Test user-visible behavior +- Make tests as isolated as possible +- Avoid testing third-party dependencies + +> **[LEARN BEST PRACTICES](https://playwright.dev/docs/best-practices)** + +See the [cookbook](#cookbook) for help in covering scenerios. It is possible to [generate tests](https://playwright.dev/docs/codegen) via the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright). + +## Running tests + +To run the tests, you may do so through the command line: + +```cmd +npm run test +``` + +Or through VS Code **(recommended)**, see [Getting started - VS Code](https://playwright.dev/docs/getting-started-vscode). + +## Recording video + +You may automatically record video with your tests by setting + +``` +use: { + video: "on" +} +``` + +in the [playwright.config.js](../playwright.config.js). After running tests, you will find the output as a `.webm` in `./test-results`. Then, [convert to MP4](https://video.online-convert.com/convert/webm-to-mp4) and share. + +It is encouraged to include video in pull requests in order to demonstrate functionality and prove thorough testing. + +## Cookbook + +### Capturing the VM Confirmation Popup + +Currently, none of the tests post actual transactions to the smart contracts. Still you should try writing your tests so that they do the actual function call, but just skip the final step of sending the transaction. You can do this by capturing the transaction confirmation popup provided by the NEAR social VM. + +```javascript +// click button that triggers transaction +await page.getByRole("button", { name: "Donate" }).nth(1).click(); + +const transactionObj = JSON.parse(await page.locator("div.modal-body code").innerText()); + +// do something with transactionObj +expect(transactionObj).toMatchObject({ + amount: 100, + message: "", + projectId: DEFAULT_PROJECT_ID, +}); +``` + +See the test called "project with no active pot should donate direct with correct amount" in donate.spec.js for a full example. diff --git a/playwright-tests/storage-states/admin-connected.json b/playwright-tests/storage-states/admin-connected.json new file mode 100644 index 0000000..c25b5db --- /dev/null +++ b/playwright-tests/storage-states/admin-connected.json @@ -0,0 +1,27 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "near-wallet-selector:selectedWalletId", + "value": "\"my-near-wallet\"" + }, + { + "name": "near_app_wallet_auth_key", + "value": "{\"accountId\":\"devs.near\"}" + }, + { + "name": "near-social-vm:v01::accountId:", + "value": "devs.near" + }, + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/storage-states/wallet-connected.json b/playwright-tests/storage-states/wallet-connected.json new file mode 100644 index 0000000..ac54d16 --- /dev/null +++ b/playwright-tests/storage-states/wallet-connected.json @@ -0,0 +1,27 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "near-wallet-selector:selectedWalletId", + "value": "\"my-near-wallet\"" + }, + { + "name": "near_app_wallet_auth_key", + "value": "{\"accountId\":\"anybody.near\"}" + }, + { + "name": "near-social-vm:v01::accountId:", + "value": "anybody.near" + }, + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/storage-states/wallet-not-connected.json b/playwright-tests/storage-states/wallet-not-connected.json new file mode 100644 index 0000000..73acb7e --- /dev/null +++ b/playwright-tests/storage-states/wallet-not-connected.json @@ -0,0 +1,15 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8080", + "localStorage": [ + { + "name": "flags", + "value": "{\"bosLoaderUrl\":\"http://127.0.0.1:3030\"}" + } + ] + } + ], + "sessionStorage": [] +} diff --git a/playwright-tests/testUtils.js b/playwright-tests/testUtils.js new file mode 100644 index 0000000..1421fef --- /dev/null +++ b/playwright-tests/testUtils.js @@ -0,0 +1,31 @@ +import { expect } from "@playwright/test"; + +export const pauseIfVideoRecording = async (page) => { + let isVideoRecorded = (await page.video()) ? true : false; + if (isVideoRecorded) { + await page.waitForTimeout(500); + } +}; + +export const setInputAndAssert = async (page, selector, value) => { + await page.fill(selector, value); + const actualValue = await page.inputValue(selector); + expect(actualValue).toBe(value); +}; + +export const selectAndAssert = async (page, selector, value) => { + await page.selectOption(selector, { value: value }); + const selectedValue = await page.$eval(selector, (select) => select.value); + expect(selectedValue).toBe(value); +}; + +export const waitForSelectorToBeVisible = async (page, selector) => { + await page.waitForSelector(selector, { + state: "visible", + }); +}; + +export const clickWhenSelectorIsVisible = async (page, selector) => { + waitForSelectorToBeVisible(page, selector); + await page.click(selector); +}; diff --git a/playwright-tests/tests/bosloaderenvironment.spec.js b/playwright-tests/tests/bosloaderenvironment.spec.js new file mode 100644 index 0000000..881579a --- /dev/null +++ b/playwright-tests/tests/bosloaderenvironment.spec.js @@ -0,0 +1,16 @@ +import { test, expect } from "@playwright/test"; + +test("should find bos loader configuration in localstorage", async ({ page }) => { + await page.goto("/"); + + const localStoreFlags = await page.evaluate(() => localStorage.getItem("flags")); + expect(localStoreFlags).toEqual( + JSON.stringify({ bosLoaderUrl: "http://127.0.0.1:8080/api/loader" }) + ); +}); + +test("should not get bos loader fetch error", async ({ page }) => { + await page.goto("/potlock.near/widget/Index?tab=projects"); + const bodyText = await page.textContent("body"); + expect(bodyText).not.toContain('Source code for "potlock.near/widget/Index" is not found'); +}); diff --git a/playwright-tests/util/constants.js b/playwright-tests/util/constants.js new file mode 100644 index 0000000..ecc9bb1 --- /dev/null +++ b/playwright-tests/util/constants.js @@ -0,0 +1,3 @@ +/** + * constants + */ diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 0000000..d28ddeb --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,107 @@ +// @ts-check +import { defineConfig, devices } from "@playwright/test"; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * @see https://playwright.dev/docs/test-configuration + */ +export default defineConfig({ + testDir: "./playwright-tests/tests", + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? "100%" : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: "line", + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + video: "off", + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: "http://localhost:8080", + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + storageState: { + cookies: [], + origins: [ + { + origin: "http://localhost:8080", + localStorage: [ + { + name: "flags", + value: JSON.stringify({ bosLoaderUrl: "http://127.0.0.1:8080/api/loader" }), + }, + ], + }, + ], + }, + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + + /*{ + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + },*/ + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { channel: 'chrome' }, + // }, + ], + + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + outputDir: "test-results/", + + /* Run your local dev server before starting the tests */ + webServer: { + command: "npm run dev", + port: 8080, + reuseExistingServer: !process.env.CI, + }, +}); diff --git a/tree.json b/tree.json index 8ce5b0d..2bd0604 100644 --- a/tree.json +++ b/tree.json @@ -1 +1,122 @@ -{"devs.near":{"./widget//ProfileEditor.jsx":"664fc39bbe02f2a39c533ab58e6544d32cb5e00f6f1f05ca8fb1e516c4ce0ae0","./widget//Community.jsx":"9f6a1c7a61d3945a46bb08724151c7cf40c55aa5ab68da6526eae0c1c6a00c05","./widget/community/Layout.jsx":"bdd0ced3e6486ce58adb2d43eecb847540cfd140a52990c8f25f3751650649d3","./widget/community/Page.jsx":"0b4f416e7af3077d948fe2c415a5b4b340f92364cf565db8d9d46e4edc29890c","./widget/community/Featured.jsx":"b86db410d30c748f1893599e027082a122f2c5e8c236e17943b3d4c74f49dd1b","./widget/community/Groups.jsx":"6dc7ba694120cbf1096ee2ff40e0a1895ba6503b16680be01ee33772d8f0133d","./widget/dev/social.jsx":"cd7ef39ff52e2afafd4cd76e91bb3c90c236613cb0847cd6f10dffd81acb1181","./widget/dev/info.jsx":"eb7d0ff5d0faf189afddffc58032c8d6714007e170d006661dab3e33d7b5aab4","./widget/dev/search.jsx":"3ece5fbfbef9b5cdf19d9369060a43fadb2a5a772d742b4527cdf97e2b9608b8","./widget/dev/main.jsx":"0f8fa57fcc5cd56c021e711e05cf0521768386ef7f1967e8a101e4f0497dbce8","./widget/dev/profile.jsx":"5dd9cc2fc060a11727949060c101ec669b506a84375d2da02c6e31c289d26c27","./widget/dev/menu.jsx":"7a8e41243f9f080811935210d2d88c348b8299e5b1f4d868e6727022381db9ff","./widget/dev/Rank.jsx":"eb3a8acf3d55aa516ee631bff8999eb4ad616d57945ba74458c324eae9e8e668","./widget/community/Rank.jsx":"1450d21c5746f68f7b49e48512201926e5ed63be1c3dd8fcf63fdffd48df5835","./widget/dev/collab.jsx":"6d27e7e53e83269f527980b0a6e08fecebbdd3ac606149b1b721dc928bf7177c","./widget/dev/feed.jsx":"4283c04636561e30260dce25de2f949a1f1f6f9eba37f2b32906862fd21d1a5a","./widget/dev/side.jsx":"f9e4752cb2fc8ced9b882108ecb56f3e27fc5c922a78f7eaeddcf01f816015d6","./widget/dev/config.jsx":"9a226b7d1b03e78ae9146f0d78455a445c0110e4ad8c4d3eff953bc6ea185000","./widget/dev/community.jsx":"51a6356b886258cc0c8984be453f3e8d9aae9c139b71d6b748557b084b098cc1","./widget/dev/posts.jsx":"725cf1e0541f2255f0a3ca2eb643cf673969fdbe186ba0b4360015913f2ed687","./widget/community/cta.jsx":"2ae9a746df0ca3b68bbe676d967e23e2bd21be66e19b89c7ad91729e66b46830","./widget/dev/tabs.jsx":"ad82b6460b566ded4a2b42083efad75b2875a028c15cfcbc9c9468c32a9c4efb","./widget/community/view.jsx":"8b760c4e3e2d17b1c1d13edf74836530f925039d84978717f16d21b69e616926","./widget/dev/rank.jsx":"e642b8d5f42e690cd83ef99542bf2b7f9a36a83114e3a8685b56e7b5da047647","./widget//components.jsx":"5a7f994612135e440c658f99afd3d43d2eb83340d9479171f95d71d56196d0d8","./widget/dev/library.jsx":"1b6dcedbb56ba8eba66c05a2c9903a57437e2c9e46341d448d633db63ea6840f","./widget//SetFlagButton.jsx":"2a0c8c495dea45d871ab846f11f4a1f8905226ba9384c0e262819b29d14cfb06","./widget//GithubForkButton.jsx":"d2ab2b56d6d088daa095eb40321a736c9cbcd27bda2caf7d19e5dd1ee2d143a5","./widget//community.jsx":"a588ff3f28bb9f9d4720bd261b87369b682721e4d36b52323c51a4f519e7ac88","./widget//update.jsx":"c3138d734dead3f936a3a8ab14cb24e017b8ca438b06dddf0069166391370efd","./widget//Router.jsx":"dcc6ffe9011e4dcc703121c66e44d3ff1c4e827be3792d76b49f053de5fd90d1","./widget//Navigator.jsx":"01422fe540d651afc0bbfebddf0b10ee038252dc679809407d719529654f5b8b","./widget//Feed.jsx":"2b7797814a1869ab644a3ad403581f8ad450552eb6b2b86f6350fa6f73e5de33","./widget//Compose.jsx":"6c10d61d8708ddbc5d6e2d6fe209c4d0dcaf1d40075695e47ab96a87039ca141","./widget/Module/ContextMenu.jsx":"44f23dae87f070e3cdf1c66cedf712139667cd1ffe3f732dca339cda1a16c29f","./widget/Module/Modal.jsx":"a9c40fefa6afdb0b2f574cd9cac62e32956e62b123030fa715a38465b85312ba","./widget/GitBos/kit.jsx":"21883a5aa2ee5a14f2e977f44293f3991876b677bd07c38cffb42720e2563628","./widget/group/edit.jsx":"4897cfe6a9ea98a6475f413774b70647b09a8ba41a2300a6bc5c3b1f7ac8f69e","./widget/group/index.jsx":"a641746c9a2f2d71a78d95a460ecf18cc581a1f6f895f6a71e82e0ee5956f609","./widget/group/members.jsx":"69b17b9610fa45a06b8791c5b6b0bb7665a5d6941969ac44ad7ae5e75d314312","./widget/group/settings.jsx":"c21bcc14cb83a4870431f67a53c4a13123ce81508d554c34fcecf17d851426b7","./widget/group/page.jsx":"0784dd3ecb665daa393bdbea0069ad611a4f110f100ca8395d46255dd32311bc","./widget/group/join.jsx":"732c439750da7a721b8b0f736ca01ee1f2866be3f01dd9caf04cd31718b37733","./widget/group/overlay.jsx":"6f71da23d2ba424ce6b045f4556c1a11fa1d4926a787e6ad82b2dbc77f6a881e","./widget/group/inline.jsx":"d6e39dbfc09265fffd2cf2c0055532588915c262a19bc15646aafd3aea8a61c3","./widget/group/stats.jsx":"ae1c135426aaecfff2c11eaca5607aa71c0f4b9cd958431da203ade78633497d","./widget//MonacoEditor.jsx":"47397a09bede53d97823513f25e165391d330598c16edcbf0aff811320022c9d","./widget//dbos.jsx":"ab27ec148ad3a5fda1076c9aa4d05de5b369a59b60d3ff562e7b9a1ec7704ed0","./widget/group/info.jsx":"8539cf37a94764ea4516c95b0ae6d56b37b4b158656b73e47322d30b370e3cac","./widget/group/image.jsx":"b7969f45d418a31736f0fb00c65add6b8aca4d5d2fc78e6822d634930ec6906c","./widget/group/card.jsx":"15661edacf8e8da550c0d0d3bb6f8cda6dae0d8095702d9e319d32c58f421d4f","./widget//view.jsx":"51f834e8efd75322db9e0ad27f6f67861dc0301b476821b3ec671bf7dc1e4ab8","./widget//app.jsx":"2c0844e82c60761e5e90f8596dbf9ca4ae386c3fa34cc6c5a366df6b9fd9885e","./widget/adapter/sputnik-dao.jsx":"5c3d42490d41eb03dae17d192c0cc216d5910ed314ca2dedd2254634f4532856","./widget/canvas/view.jsx":"fcdeb51073af54823fec4525ac17143802debd264d8ac89400d13479caddd546","./widget//provider.jsx":"2075b6a2063e27bdf491e9e349b6d7ce4c7079d137fdf8f894014c6ae25971a5","./widget//Library.jsx":"d7601ec79f62656368898c8ed353eab3efd2f49a3b7b7e4b159c6f28f2c7e848","./widget//ContextMenu.jsx":"0ce1904fb195b5f17c68b0c30e392e3412845d6428ecb9adb5f059529ee65f50","./widget//hyperfile.jsx":"d9cfd6a2859ac5c594d54b75930cb6243baaa6601a8e7b2a0751091833d0bfb5","./widget/markdown/SimpleMDE.jsx":"f6b7d7278f30bf505e8a3a00b2a0e79348416fe7a797d3eb9a78a6f12280405e","./widget/adapter/openai.jsx":"dd8fc67ac200178e599b306183f8f097502ee16cf4bd5fd6183fd58edf85d054","./widget/markdown/MarkdownEditorIframe.jsx":"7c57f0271f608a050f18ec94303211ee2bc792e19eeb92b429b2c9f67d6e1278","./widget//group.jsx":"d92ed9cbb230943047fabe1ce517e0f1e59dc6db434dac84f1fc3aa697a86e7e","./widget//App.jsx":"36739b5b51b4a6318c69e151010db0c7b430ac2d8ebc6cf93def623b85c8f3f2","./widget//Layout.jsx":"8f4e56f95d3e00fd26b6adcc8573ff4e7e4c77fdf674eb09a40d99eada32e6ec","./widget/PR/ItemFeed.jsx":"edfdcffa00f66ad1727ae1fafeb9663d7807c4b720355f1b705d37fa34a2f8da","./widget//Thing.jsx":"d3a62dda0eac00dcac89ffc215034e8c84a3360d91e228cee869fbae64ec46c5","./widget//default.jsx":"a145aba22b04934d1936355a590bb2deea2aecee61cd36f05c8427526dafad42","./widget//Modal.jsx":"51e77f9fb846bfb57e52eea68536d46a46082290419135fdfc40a8541d3bdfc8","./widget//ProfileWidget.jsx":"ef4a22241f526bf928853195bc49f8bbde368439beb08471bb95cafe1b93da2f","./widget/Dev/Social.jsx":"6ae053518fa216345ea42c5c86a05bb34afba51400b2788d887f018cbd72e71f","./widget/community/Overview.jsx":"20d6c4e83e4fc77cbb769b74e18a013ef56e2fb380ef0b23fc6416138776bdde","./widget/devs/Rank.jsx":"f4d278c1c3a770f2229db0c94ba53867c04d2de3fc3445dfff0b5582ef70ba22","./widget/community/Hashtag/Feed.jsx":"4e14d26130115fcaa02fc4922b953d34fc425c03f06090e53a0b5407e4139dfc","./widget/dev/side/config.jsx":"e82d617f1cc1a4c1a132a7437a39f18b9ba4c3edac68d0bec88cd683bf4451b4","./widget//sidebar.jsx":"eb1e1561e5cbef334366b8eef78de99630b620fa1762c6f4a1548cbfa182a134","./widget/explore/posts.jsx":"e69b05a51f4ebad08b10a2312b11dcb7b945ea6915243790f6ef3b3adbb1c093","./widget/dao/connect.jsx":"9a8fb2ff2cf699147e940ecc1dff58e86df37080e9a83d0b49e1da7afe40082b","./widget/widgets/latest.jsx":"1b91e499d7f5b44a3d4488846554861af0828f37a23eea571416e57ad48df29b","./widget/widget/card.jsx":"db6a5bdfda7ecc11456c9983d732c149342c9d75f8019f8a720b1899258139ce","./widget/view/posts.jsx":"cfdb879bcda6dabf5ab66dd471f9ed1706928ef517b5af53d2cb8a7b17bb22fe","./widget/profile/page.jsx":"0e17e619aa6c06c409fa1e94b494f66bc73dfbe4ab7555c7ea8077c23f4bc722","./widget/dev/main/config.jsx":"0ea33bcab971ae170b633da9fa0e19428a0ab92dadd086f6e9c534086b7b85eb","./widget/component/card.jsx":"51e1ee0b21da6a64c645a9c1d02fa4800669a0be0d1f2a42bea49d31b518b6a9","./widget/everything/sdk.jsx":"8f00297b3cf355ce7d4cac07ee66f0e9a11d853560e6656db22948715aba7732","./widget/docs/view.jsx":"8aaaddccb3eb7643c6b12c784d757d44552d6c077abc74c0aa9ecffe2da4807b","./widget/Livepeer/Creator.jsx":"c161cedf4ae01b875f402f926a24197a0de892be3ffa8afa39b411d8327e71e5","./widget/group/create.jsx":"cb0c43bedda681023bd821995d8dbee1e0e11ffdbaac4456a3188f53c5ceea69","./widget/PR/MergedIndexFeed.jsx":"59f9d7d8f21017995dca3642182e219b6d23d5d69ad8ef5fe7d0a8bfc968d3ab","./widget/Module/Feed.jsx":"687074eb7443ae6475b76b2cc311ac566b57292b44e1c729db5ef8787724f713","./widget/GitBos/info.jsx":"22ed68fef1571ad3a545b00c6d0f7a66d4649dbfd07c2520f4c355f7e845fb45","./widget/Notification/Item.jsx":"9a15f632f5f8438ab857a2d6c03d5e4e8c3f3b70f409652aee1ab718639c1d12","./widget/Module/Feed/demo.jsx":"005418591a2884b23627fa31f3894af03076742c56541f2a3c14934e76dc0ce8","./widget/create/posts.jsx":"d2474760074e9e975973be44ff8cc869854a2599bee61427c2ab83953692ddec","./widget/post/feed.jsx":"8f5281db608fe5851cfda99e8c1ace02ab8f5d802eaa25ddf6ae69e2e670264d","./widget/group/overlay/trigger.jsx":"e8a71f46b2527da379943f9b553da9c7fcb6080b8556784419d3dce171d5ce50","./widget/code/edit.jsx":"8f70c745130670c4df21f0b8c76deffe2f7a24269d4f6b317f7d9c5840c1adef","./widget/every/group.jsx":"75d8b41a2211e0aa973c0a0618c994cb166b75fdc56f1b6954f61118aaf5bd36","./widget/markdown/view.jsx":"6efdab7cab8d6eebe40d7385773b86526628017e4c3c5f8f4fc732963edec013","./widget/hyperfile/create.jsx":"1867e9001bc2227315866d4bee2f67e0ca111b95f2e333a9201da4a9cfeb79d8","./widget/adapter/github.jsx":"8478f2745a9b39544bcacbf9a863598c63c2ab5620aefbc850d69044d4f8f36e","./widget/Common/Compose.jsx":"bcbcaa69c81bbf8f3e81f35f72e627d9da74bfeb96403c17868c68c67d69d081","./widget/modal/create.jsx":"c4f7ff93923b80169537332683f891d8fb059b571fcef97703dd956004a3430f","./widget/GitBos/kit/editor.jsx":"01be065aa2dae8d26fcaf2ddfa8cb84905d7da7e6490d3bb0fff0926388192cf","./widget/lib/url.jsx":"e777c8c21a3f3d6a614681896ec2d1d6cd57cf164b7c1f79302f9db827b3b80b","./widget/Feed/demo.jsx":"95e0ac01b92956fa21c6b15d5573df0e75322eafea7bc77f72a93a10c2fb7626","./widget//MetadataEditor.jsx":"8b51fefe2336a3973e1159883bc54f0096867486e588d3f71ad25076fbe03466","./widget/community/Banner.jsx":"7a4391acecf27ef40f6a0351ccbbcbc01326013d3070e37e3545a2eaf15ef875","./widget/community/Header.jsx":"16da93a9d9b82dbbfa449901633887081fc4b4dbc58ac50334a22470a56406d5","./widget/canvas/edit.jsx":"75fd65edf5019e74611549a3799cdea28f75060ef6a5b8d73a598cc79d29e132","./widget/PR/FilteredIndexFeed.jsx":"8f47a629abf258e13f49bf6986cfe2d5aaaa4cdcd13972a05113f1059ccdf2fd","./widget/PR/IndexFeed.jsx":"65781939bdc7c412b232164435a9e4216e6cd48dc7373228a2c17d8dddc17702","./widget/code/view.jsx":"0865edf176f7301fb7488fc8ad7b65f4fc473965ba9c0d320eb52964ea91ddbd","./widget/markdown/edit.jsx":"afdf102677b618f96a351d7d958ccd75839274891884c5909b855a7133fafdf9","./widget/Common/AccountAutocomplete.jsx":"96e7a849b24a600da76c398b2152b3b7306d7771f8c5266b9a0dba76a3c2fd79","./widget/modal/post.jsx":"b00ce5ab5eb322dfd6d1515dd4201176f7e8c7245496505b3302eee56d3e7265","./widget/every/feed/view.jsx":"c96c9a7393d6153aedea89c6334ab6730d459cda3d901d62b682035ae54b9003","./widget/bos/Hashtag/Feed.jsx":"fbd19598f19fbc91c3f01d966c0f00b6fc2268aff4a25b6699dcbe649ff82ddb"}} \ No newline at end of file +{ + "devs.near": { + "./widget//ProfileEditor.jsx": "664fc39bbe02f2a39c533ab58e6544d32cb5e00f6f1f05ca8fb1e516c4ce0ae0", + "./widget//Community.jsx": "9f6a1c7a61d3945a46bb08724151c7cf40c55aa5ab68da6526eae0c1c6a00c05", + "./widget/community/Layout.jsx": "bdd0ced3e6486ce58adb2d43eecb847540cfd140a52990c8f25f3751650649d3", + "./widget/community/Page.jsx": "0b4f416e7af3077d948fe2c415a5b4b340f92364cf565db8d9d46e4edc29890c", + "./widget/community/Featured.jsx": "b86db410d30c748f1893599e027082a122f2c5e8c236e17943b3d4c74f49dd1b", + "./widget/community/Groups.jsx": "6dc7ba694120cbf1096ee2ff40e0a1895ba6503b16680be01ee33772d8f0133d", + "./widget/dev/social.jsx": "cd7ef39ff52e2afafd4cd76e91bb3c90c236613cb0847cd6f10dffd81acb1181", + "./widget/dev/info.jsx": "eb7d0ff5d0faf189afddffc58032c8d6714007e170d006661dab3e33d7b5aab4", + "./widget/dev/search.jsx": "3ece5fbfbef9b5cdf19d9369060a43fadb2a5a772d742b4527cdf97e2b9608b8", + "./widget/dev/main.jsx": "0f8fa57fcc5cd56c021e711e05cf0521768386ef7f1967e8a101e4f0497dbce8", + "./widget/dev/profile.jsx": "5dd9cc2fc060a11727949060c101ec669b506a84375d2da02c6e31c289d26c27", + "./widget/dev/menu.jsx": "7a8e41243f9f080811935210d2d88c348b8299e5b1f4d868e6727022381db9ff", + "./widget/dev/Rank.jsx": "eb3a8acf3d55aa516ee631bff8999eb4ad616d57945ba74458c324eae9e8e668", + "./widget/community/Rank.jsx": "1450d21c5746f68f7b49e48512201926e5ed63be1c3dd8fcf63fdffd48df5835", + "./widget/dev/collab.jsx": "6d27e7e53e83269f527980b0a6e08fecebbdd3ac606149b1b721dc928bf7177c", + "./widget/dev/feed.jsx": "4283c04636561e30260dce25de2f949a1f1f6f9eba37f2b32906862fd21d1a5a", + "./widget/dev/side.jsx": "f9e4752cb2fc8ced9b882108ecb56f3e27fc5c922a78f7eaeddcf01f816015d6", + "./widget/dev/config.jsx": "9a226b7d1b03e78ae9146f0d78455a445c0110e4ad8c4d3eff953bc6ea185000", + "./widget/dev/community.jsx": "51a6356b886258cc0c8984be453f3e8d9aae9c139b71d6b748557b084b098cc1", + "./widget/dev/posts.jsx": "725cf1e0541f2255f0a3ca2eb643cf673969fdbe186ba0b4360015913f2ed687", + "./widget/community/cta.jsx": "2ae9a746df0ca3b68bbe676d967e23e2bd21be66e19b89c7ad91729e66b46830", + "./widget/dev/tabs.jsx": "ad82b6460b566ded4a2b42083efad75b2875a028c15cfcbc9c9468c32a9c4efb", + "./widget/community/view.jsx": "8b760c4e3e2d17b1c1d13edf74836530f925039d84978717f16d21b69e616926", + "./widget/dev/rank.jsx": "e642b8d5f42e690cd83ef99542bf2b7f9a36a83114e3a8685b56e7b5da047647", + "./widget//components.jsx": "5a7f994612135e440c658f99afd3d43d2eb83340d9479171f95d71d56196d0d8", + "./widget/dev/library.jsx": "1b6dcedbb56ba8eba66c05a2c9903a57437e2c9e46341d448d633db63ea6840f", + "./widget//SetFlagButton.jsx": "2a0c8c495dea45d871ab846f11f4a1f8905226ba9384c0e262819b29d14cfb06", + "./widget//GithubForkButton.jsx": "d2ab2b56d6d088daa095eb40321a736c9cbcd27bda2caf7d19e5dd1ee2d143a5", + "./widget//community.jsx": "a588ff3f28bb9f9d4720bd261b87369b682721e4d36b52323c51a4f519e7ac88", + "./widget//update.jsx": "c3138d734dead3f936a3a8ab14cb24e017b8ca438b06dddf0069166391370efd", + "./widget//Router.jsx": "dcc6ffe9011e4dcc703121c66e44d3ff1c4e827be3792d76b49f053de5fd90d1", + "./widget//Navigator.jsx": "01422fe540d651afc0bbfebddf0b10ee038252dc679809407d719529654f5b8b", + "./widget//Feed.jsx": "2b7797814a1869ab644a3ad403581f8ad450552eb6b2b86f6350fa6f73e5de33", + "./widget//Compose.jsx": "6c10d61d8708ddbc5d6e2d6fe209c4d0dcaf1d40075695e47ab96a87039ca141", + "./widget/Module/ContextMenu.jsx": "44f23dae87f070e3cdf1c66cedf712139667cd1ffe3f732dca339cda1a16c29f", + "./widget/Module/Modal.jsx": "a9c40fefa6afdb0b2f574cd9cac62e32956e62b123030fa715a38465b85312ba", + "./widget/GitBos/kit.jsx": "21883a5aa2ee5a14f2e977f44293f3991876b677bd07c38cffb42720e2563628", + "./widget/group/edit.jsx": "4897cfe6a9ea98a6475f413774b70647b09a8ba41a2300a6bc5c3b1f7ac8f69e", + "./widget/group/index.jsx": "a641746c9a2f2d71a78d95a460ecf18cc581a1f6f895f6a71e82e0ee5956f609", + "./widget/group/members.jsx": "69b17b9610fa45a06b8791c5b6b0bb7665a5d6941969ac44ad7ae5e75d314312", + "./widget/group/settings.jsx": "c21bcc14cb83a4870431f67a53c4a13123ce81508d554c34fcecf17d851426b7", + "./widget/group/page.jsx": "0784dd3ecb665daa393bdbea0069ad611a4f110f100ca8395d46255dd32311bc", + "./widget/group/join.jsx": "732c439750da7a721b8b0f736ca01ee1f2866be3f01dd9caf04cd31718b37733", + "./widget/group/overlay.jsx": "6f71da23d2ba424ce6b045f4556c1a11fa1d4926a787e6ad82b2dbc77f6a881e", + "./widget/group/inline.jsx": "d6e39dbfc09265fffd2cf2c0055532588915c262a19bc15646aafd3aea8a61c3", + "./widget/group/stats.jsx": "ae1c135426aaecfff2c11eaca5607aa71c0f4b9cd958431da203ade78633497d", + "./widget//MonacoEditor.jsx": "47397a09bede53d97823513f25e165391d330598c16edcbf0aff811320022c9d", + "./widget//dbos.jsx": "ab27ec148ad3a5fda1076c9aa4d05de5b369a59b60d3ff562e7b9a1ec7704ed0", + "./widget/group/info.jsx": "8539cf37a94764ea4516c95b0ae6d56b37b4b158656b73e47322d30b370e3cac", + "./widget/group/image.jsx": "b7969f45d418a31736f0fb00c65add6b8aca4d5d2fc78e6822d634930ec6906c", + "./widget/group/card.jsx": "15661edacf8e8da550c0d0d3bb6f8cda6dae0d8095702d9e319d32c58f421d4f", + "./widget//view.jsx": "51f834e8efd75322db9e0ad27f6f67861dc0301b476821b3ec671bf7dc1e4ab8", + "./widget//app.jsx": "2c0844e82c60761e5e90f8596dbf9ca4ae386c3fa34cc6c5a366df6b9fd9885e", + "./widget/adapter/sputnik-dao.jsx": "5c3d42490d41eb03dae17d192c0cc216d5910ed314ca2dedd2254634f4532856", + "./widget/canvas/view.jsx": "fcdeb51073af54823fec4525ac17143802debd264d8ac89400d13479caddd546", + "./widget//provider.jsx": "2075b6a2063e27bdf491e9e349b6d7ce4c7079d137fdf8f894014c6ae25971a5", + "./widget//Library.jsx": "d7601ec79f62656368898c8ed353eab3efd2f49a3b7b7e4b159c6f28f2c7e848", + "./widget//ContextMenu.jsx": "0ce1904fb195b5f17c68b0c30e392e3412845d6428ecb9adb5f059529ee65f50", + "./widget//hyperfile.jsx": "d9cfd6a2859ac5c594d54b75930cb6243baaa6601a8e7b2a0751091833d0bfb5", + "./widget/markdown/SimpleMDE.jsx": "f6b7d7278f30bf505e8a3a00b2a0e79348416fe7a797d3eb9a78a6f12280405e", + "./widget/adapter/openai.jsx": "dd8fc67ac200178e599b306183f8f097502ee16cf4bd5fd6183fd58edf85d054", + "./widget/markdown/MarkdownEditorIframe.jsx": "7c57f0271f608a050f18ec94303211ee2bc792e19eeb92b429b2c9f67d6e1278", + "./widget//group.jsx": "d92ed9cbb230943047fabe1ce517e0f1e59dc6db434dac84f1fc3aa697a86e7e", + "./widget//App.jsx": "36739b5b51b4a6318c69e151010db0c7b430ac2d8ebc6cf93def623b85c8f3f2", + "./widget//Layout.jsx": "8f4e56f95d3e00fd26b6adcc8573ff4e7e4c77fdf674eb09a40d99eada32e6ec", + "./widget/PR/ItemFeed.jsx": "edfdcffa00f66ad1727ae1fafeb9663d7807c4b720355f1b705d37fa34a2f8da", + "./widget//Thing.jsx": "d3a62dda0eac00dcac89ffc215034e8c84a3360d91e228cee869fbae64ec46c5", + "./widget//default.jsx": "a145aba22b04934d1936355a590bb2deea2aecee61cd36f05c8427526dafad42", + "./widget//Modal.jsx": "51e77f9fb846bfb57e52eea68536d46a46082290419135fdfc40a8541d3bdfc8", + "./widget//ProfileWidget.jsx": "ef4a22241f526bf928853195bc49f8bbde368439beb08471bb95cafe1b93da2f", + "./widget/Dev/Social.jsx": "6ae053518fa216345ea42c5c86a05bb34afba51400b2788d887f018cbd72e71f", + "./widget/community/Overview.jsx": "20d6c4e83e4fc77cbb769b74e18a013ef56e2fb380ef0b23fc6416138776bdde", + "./widget/devs/Rank.jsx": "f4d278c1c3a770f2229db0c94ba53867c04d2de3fc3445dfff0b5582ef70ba22", + "./widget/community/Hashtag/Feed.jsx": "4e14d26130115fcaa02fc4922b953d34fc425c03f06090e53a0b5407e4139dfc", + "./widget/dev/side/config.jsx": "e82d617f1cc1a4c1a132a7437a39f18b9ba4c3edac68d0bec88cd683bf4451b4", + "./widget//sidebar.jsx": "eb1e1561e5cbef334366b8eef78de99630b620fa1762c6f4a1548cbfa182a134", + "./widget/explore/posts.jsx": "e69b05a51f4ebad08b10a2312b11dcb7b945ea6915243790f6ef3b3adbb1c093", + "./widget/dao/connect.jsx": "9a8fb2ff2cf699147e940ecc1dff58e86df37080e9a83d0b49e1da7afe40082b", + "./widget/widgets/latest.jsx": "1b91e499d7f5b44a3d4488846554861af0828f37a23eea571416e57ad48df29b", + "./widget/widget/card.jsx": "db6a5bdfda7ecc11456c9983d732c149342c9d75f8019f8a720b1899258139ce", + "./widget/view/posts.jsx": "cfdb879bcda6dabf5ab66dd471f9ed1706928ef517b5af53d2cb8a7b17bb22fe", + "./widget/profile/page.jsx": "0e17e619aa6c06c409fa1e94b494f66bc73dfbe4ab7555c7ea8077c23f4bc722", + "./widget/dev/main/config.jsx": "0ea33bcab971ae170b633da9fa0e19428a0ab92dadd086f6e9c534086b7b85eb", + "./widget/component/card.jsx": "51e1ee0b21da6a64c645a9c1d02fa4800669a0be0d1f2a42bea49d31b518b6a9", + "./widget/everything/sdk.jsx": "8f00297b3cf355ce7d4cac07ee66f0e9a11d853560e6656db22948715aba7732", + "./widget/docs/view.jsx": "8aaaddccb3eb7643c6b12c784d757d44552d6c077abc74c0aa9ecffe2da4807b", + "./widget/Livepeer/Creator.jsx": "c161cedf4ae01b875f402f926a24197a0de892be3ffa8afa39b411d8327e71e5", + "./widget/group/create.jsx": "cb0c43bedda681023bd821995d8dbee1e0e11ffdbaac4456a3188f53c5ceea69", + "./widget/PR/MergedIndexFeed.jsx": "59f9d7d8f21017995dca3642182e219b6d23d5d69ad8ef5fe7d0a8bfc968d3ab", + "./widget/Module/Feed.jsx": "687074eb7443ae6475b76b2cc311ac566b57292b44e1c729db5ef8787724f713", + "./widget/GitBos/info.jsx": "22ed68fef1571ad3a545b00c6d0f7a66d4649dbfd07c2520f4c355f7e845fb45", + "./widget/Notification/Item.jsx": "9a15f632f5f8438ab857a2d6c03d5e4e8c3f3b70f409652aee1ab718639c1d12", + "./widget/Module/Feed/demo.jsx": "005418591a2884b23627fa31f3894af03076742c56541f2a3c14934e76dc0ce8", + "./widget/create/posts.jsx": "d2474760074e9e975973be44ff8cc869854a2599bee61427c2ab83953692ddec", + "./widget/post/feed.jsx": "8f5281db608fe5851cfda99e8c1ace02ab8f5d802eaa25ddf6ae69e2e670264d", + "./widget/group/overlay/trigger.jsx": "e8a71f46b2527da379943f9b553da9c7fcb6080b8556784419d3dce171d5ce50", + "./widget/code/edit.jsx": "8f70c745130670c4df21f0b8c76deffe2f7a24269d4f6b317f7d9c5840c1adef", + "./widget/every/group.jsx": "75d8b41a2211e0aa973c0a0618c994cb166b75fdc56f1b6954f61118aaf5bd36", + "./widget/markdown/view.jsx": "6efdab7cab8d6eebe40d7385773b86526628017e4c3c5f8f4fc732963edec013", + "./widget/hyperfile/create.jsx": "1867e9001bc2227315866d4bee2f67e0ca111b95f2e333a9201da4a9cfeb79d8", + "./widget/adapter/github.jsx": "8478f2745a9b39544bcacbf9a863598c63c2ab5620aefbc850d69044d4f8f36e", + "./widget/Common/Compose.jsx": "bcbcaa69c81bbf8f3e81f35f72e627d9da74bfeb96403c17868c68c67d69d081", + "./widget/modal/create.jsx": "c4f7ff93923b80169537332683f891d8fb059b571fcef97703dd956004a3430f", + "./widget/GitBos/kit/editor.jsx": "01be065aa2dae8d26fcaf2ddfa8cb84905d7da7e6490d3bb0fff0926388192cf", + "./widget/lib/url.jsx": "e777c8c21a3f3d6a614681896ec2d1d6cd57cf164b7c1f79302f9db827b3b80b", + "./widget/Feed/demo.jsx": "95e0ac01b92956fa21c6b15d5573df0e75322eafea7bc77f72a93a10c2fb7626", + "./widget//MetadataEditor.jsx": "8b51fefe2336a3973e1159883bc54f0096867486e588d3f71ad25076fbe03466", + "./widget/community/Banner.jsx": "7a4391acecf27ef40f6a0351ccbbcbc01326013d3070e37e3545a2eaf15ef875", + "./widget/community/Header.jsx": "16da93a9d9b82dbbfa449901633887081fc4b4dbc58ac50334a22470a56406d5", + "./widget/canvas/edit.jsx": "75fd65edf5019e74611549a3799cdea28f75060ef6a5b8d73a598cc79d29e132", + "./widget/PR/FilteredIndexFeed.jsx": "8f47a629abf258e13f49bf6986cfe2d5aaaa4cdcd13972a05113f1059ccdf2fd", + "./widget/PR/IndexFeed.jsx": "65781939bdc7c412b232164435a9e4216e6cd48dc7373228a2c17d8dddc17702", + "./widget/code/view.jsx": "0865edf176f7301fb7488fc8ad7b65f4fc473965ba9c0d320eb52964ea91ddbd", + "./widget/markdown/edit.jsx": "afdf102677b618f96a351d7d958ccd75839274891884c5909b855a7133fafdf9", + "./widget/Common/AccountAutocomplete.jsx": "96e7a849b24a600da76c398b2152b3b7306d7771f8c5266b9a0dba76a3c2fd79", + "./widget/modal/post.jsx": "b00ce5ab5eb322dfd6d1515dd4201176f7e8c7245496505b3302eee56d3e7265", + "./widget/every/feed/view.jsx": "c96c9a7393d6153aedea89c6334ab6730d459cda3d901d62b682035ae54b9003", + "./widget/bos/Hashtag/Feed.jsx": "fbd19598f19fbc91c3f01d966c0f00b6fc2268aff4a25b6699dcbe649ff82ddb" + } +} diff --git a/widget/Common/AccountAutocomplete.jsx b/widget/Common/AccountAutocomplete.jsx index 622db50..e23557d 100644 --- a/widget/Common/AccountAutocomplete.jsx +++ b/widget/Common/AccountAutocomplete.jsx @@ -2,10 +2,7 @@ if (!context.accountId || !props.term) return <>; let results = []; const profilesData = Social.get("*/profile/name", "final") || {}; -const followingData = Social.get( - `${context.accountId}/graph/follow/**`, - "final" -); +const followingData = Social.get(`${context.accountId}/graph/follow/**`, "final"); if (!profilesData || !followingData) return <>; @@ -17,9 +14,7 @@ for (let i = 0; i < profiles.length; i++) { let score = 0; const accountId = profiles[i][0]; const accountIdSearch = profiles[i][0].replace(/\W/g, "").toLowerCase(); - const nameSearch = (profiles[i][1]?.profile?.name || "") - .replace(/\W/g, "") - .toLowerCase(); + const nameSearch = (profiles[i][1]?.profile?.name || "").replace(/\W/g, "").toLowerCase(); const accountIdSearchIndex = accountIdSearch.indexOf(term); const nameSearchIndex = nameSearch.indexOf(term); diff --git a/widget/Common/Compose.jsx b/widget/Common/Compose.jsx index ba9a1c9..137dc37 100644 --- a/widget/Common/Compose.jsx +++ b/widget/Common/Compose.jsx @@ -16,8 +16,7 @@ if (state.image === undefined) { if (props.onHelper) { const extractMentions = (text) => { - const mentionRegex = - /@((?:(?:[a-z\d]+[-_])*[a-z\d]+\.)*(?:[a-z\d]+[-_])*[a-z\d]+)/gi; + const mentionRegex = /@((?:(?:[a-z\d]+[-_])*[a-z\d]+\.)*(?:[a-z\d]+[-_])*[a-z\d]+)/gi; mentionRegex.lastIndex = 0; const accountIds = new Set(); for (const match of text.matchAll(mentionRegex)) { @@ -277,14 +276,7 @@ const gifSvg = ( viewBox="0 0 16 16" > - + GIF @@ -309,10 +301,7 @@ const gifSearchWidget = useMemo( [gifSearch] ); -const MemoizedAvatar = useMemo( - () => , - [context.accountId] -); +const MemoizedAvatar = useMemo(() => , [context.accountId]); useEffect(() => { if (state.text === "") { diff --git a/widget/Community.jsx b/widget/Community.jsx deleted file mode 100644 index d4304f5..0000000 --- a/widget/Community.jsx +++ /dev/null @@ -1,179 +0,0 @@ -const accountId = props.accountId ?? context.accountId; - -const creatorId = props.creatorId ?? "hack.near"; -const pageId = props.pageId ?? "community.page"; - -return ( - <> - - -); -ine-block; - background: #efa9ca; - border-radius: 20px; - position: relative; - padding: 0.1em 0.2em 0; - - svg { - position: absolute; - bottom: -8px; - right: -10px; - width: 24px; - } - } - - @media (max-width: 900px) { - font-size: 50px; - - span { - border-radius: 12px; - svg { - position: absolute; - bottom: -6px; - right: -7px; - width: 16px; - } - } - } -`; - -const Text = styled.p` - font-family: "FK Grotesk", sans-serif; - font-size: ${(p) => p.size ?? "18px"}; - line-height: ${(p) => p.lineHeight ?? "1.5"}; - font-weight: ${(p) => p.weight ?? "400"}; - color: ${(p) => p.color ?? "#000"}; - margin: 0; -`; - -const Flex = styled.div` - display: flex; - gap: ${(p) => p.gap}; - align-items: ${(p) => p.alignItems}; - justify-content: ${(p) => p.justifyContent}; - flex-direction: ${(p) => p.direction ?? "row"}; - flex-wrap: ${(p) => p.wrap ?? "nowrap"}; - - ${(p) => - p.mobileStack && - ` - @media (max-width: 900px) { - flex-direction: column; - gap: var(--section-gap); - } - `} -`; - -const Content = styled.div` - @media (max-width: 1200px) { - > div:first-child { - } - } -`; - -const Container = styled.div` - display: flex; - max-width: 1060px; - margin: 0 auto; - gap: ${(p) => p.gap ?? "var(--section-gap)"}; - flex-direction: column; - align-items: ${(p) => (p.center ? "center" : undefined)}; - justify-content: ${(p) => (p.center ? "center" : undefined)}; - text-align: ${(p) => (p.center ? "center" : undefined)}; - padding: var(--section-gap) 23px; -`; - -return ( - - {!isOwner && ( - - -

- - NDC{" "} - - - Work Groups -

-
-
- )} - - - {!isOwner ? ( - - {!accountId ? ( - - ) : ( - - )} - - ) : ( - - - - )} - - - - - Made Possible by{" "} - - NDC - - - - - -
-); diff --git a/widget/Compose.jsx b/widget/Compose.jsx index 1f4a221..5fa9536 100644 --- a/widget/Compose.jsx +++ b/widget/Compose.jsx @@ -27,15 +27,10 @@ const composeData = () => { path: `${context.accountId}/post/main`, }; - const notifications = state.extractMentionNotifications( - state.content.text, - item - ); + const notifications = state.extractMentionNotifications(state.content.text, item); if (notifications.length) { - data.index.notify = JSON.stringify( - notifications.length > 1 ? notifications : notifications[0] - ); + data.index.notify = JSON.stringify(notifications.length > 1 ? notifications : notifications[0]); } const hashtags = state.extractHashtags(state.content.text); diff --git a/widget/ContextMenu.jsx b/widget/ContextMenu.jsx index f8c426b..3c0caab 100644 --- a/widget/ContextMenu.jsx +++ b/widget/ContextMenu.jsx @@ -63,4 +63,4 @@ function ContextMenu({ Item, passProps, handlers, items }) { ); } -return { ContextMenu }; \ No newline at end of file +return { ContextMenu }; diff --git a/widget/Editor.jsx b/widget/Editor.jsx index 864c5b6..e17a66f 100644 --- a/widget/Editor.jsx +++ b/widget/Editor.jsx @@ -143,12 +143,7 @@ const types = [ ]; const DefaultEditor = ({ value, onChange, onBlur }) => ( - + ); return ( @@ -218,10 +213,7 @@ return ( }); }, toggle: ( - - - Learn More - - - - -); diff --git a/widget/GitBos/kit.jsx b/widget/GitBos/kit.jsx deleted file mode 100644 index 5c28c97..0000000 --- a/widget/GitBos/kit.jsx +++ /dev/null @@ -1,59 +0,0 @@ -const kit = context.accountId - ? Social.get(`${context.accountId}/settings/near.builders/kit`) - : undefined; - -if (kit === null) { - return ""; -} - -const defaultWidgets = [ - { - src: "${config_account}/widget/GitBos.info", - }, - { - src: "${config_account}/widget/dev.collab", - }, -]; - -const widgets = (kit && JSON.parse(kit)) ?? defaultWidgets; - -const Div = styled.div` - position: relative; - @media (hover: hover) { - > .edit-link { - display: none; - } - } - &:hover { - > .edit-link { - display: inline; - } - } -`; - -return ( -
-
-
Welcome Builders!
- {context.accountId && ( - - Customize - - )} -
-
- {widgets.map( - ({ src, requiresLogin }, i) => - (!requiresLogin || context.accountId) && ( -
- -
- ) - )} -
-
-); diff --git a/widget/GitBos/kit/editor.jsx b/widget/GitBos/kit/editor.jsx deleted file mode 100644 index c912379..0000000 --- a/widget/GitBos/kit/editor.jsx +++ /dev/null @@ -1,144 +0,0 @@ -const accountId = context.accountId; - -const kit = context.accountId - ? Social.get(`${context.accountId}/settings/near.builders/kit`) - : undefined; - -if (kit === null) { - return ""; -} - -const defaultWidgets = [ - { - src: "${config_account}/widget/GitBos.info", - }, - { - src: "${config_account}/widget/dev.collab", - }, -]; - -const settingWidgets = kit && JSON.parse(kit); - -if (state.widgets === undefined) { - const widgets = settingWidgets ?? defaultWidgets; - State.update({ widgets }); -} - -const move = (fromIndex, toIndex) => { - const widget = state.widgets.splice(fromIndex, 1)[0]; - if (toIndex !== undefined) { - state.widgets.splice(toIndex, 0, widget); - } - State.update(); -}; - -const renderMenu = (src, requireLogin, index) => { - return ( -
-
{src}
- - - - - -
- ); -}; - -const openButton = ({ widgetPath: src, onHide }) => { - return ( - - ); -}; - -return ( - <> -

GitBos Kit

-
- -
-
- - Update - - {settingWidgets && - JSON.stringify(state.widgets) !== JSON.stringify(settingWidgets) && ( - - )} - {JSON.stringify(state.widgets) !== JSON.stringify(defaultWidgets) && ( - - )} -
-
- {state.widgets.map(({ src, requiresLogin }, i) => ( -
- {renderMenu(src, requireLogin, i)} -
- -
-
- ))} - -); diff --git a/widget/Layout.demo.jsx b/widget/Layout.demo.jsx index 1102ae5..18c15e7 100644 --- a/widget/Layout.demo.jsx +++ b/widget/Layout.demo.jsx @@ -29,10 +29,7 @@ const Block = styled.div` return ( <> - setSelectedLayout(e.target.value)}> {variants.map((variant) => (