diff --git a/.env-sample b/.env-sample index 9391552e..66de2785 100644 --- a/.env-sample +++ b/.env-sample @@ -22,11 +22,6 @@ OLSK_VERSION_LIMIT=50 KVC_TEMPLATE_NORMALIZE_URL=https://cdn.jsdelivr.net/npm/normalize.css/normalize.css KVC_TEMPLATE_DECOR_URL=https://cdn.jsdelivr.net/gh/olsk/OLSKDecor/ui-style.css -OLSK_FUND_FORM_URL=https://fund.rosano.ca -OLSK_FUND_API_URL=https://fund.rosano.ca/api/grant -OLSK_FUND_PRICING_STRING="0:10 10,100 50,500 250" -OLSK_FUND_DOCUMENT_LIMIT=100 - OLSK_LAYOUT_TOUCH_ICON_URL=https://static.rosano.ca/wikiavec/touch.png ROCO_SHARED_PROJECT_ID=RP_003 diff --git a/os-app/open-guide/text-en.md b/os-app/open-guide/text-en.md index 5c887ed5..31ca4ce3 100644 --- a/os-app/open-guide/text-en.md +++ b/os-app/open-guide/text-en.md @@ -168,8 +168,6 @@ After setting up a custom domain, designate any note as the home page with the ` | `KVCWriteLauncherItemConfigureCustomTemplateText` | Launcher | | `KVCWriteLauncherItemRemoveCustomTemplateText` | Launcher | | `OLSKRemoteStorageLauncherItemCopyLoginLinkText` | Launcher | -| `OLSKFundLauncherItemEnterClueText` | Launcher | -| `OLSKFundLauncherItemClearClueText` | Launcher | | `OLSKRemoteStorageLauncherItemDebugFlushDataText` | Launcher | # Add to Home screen on mobile and tablet devices diff --git a/os-app/open-write/main.svelte b/os-app/open-write/main.svelte index 88644d2e..e23726a0 100644 --- a/os-app/open-write/main.svelte +++ b/os-app/open-write/main.svelte @@ -13,7 +13,6 @@ import RemoteStorage from 'remotestoragejs'; import KVCTemplate from '../_shared/KVCTemplate/main.js'; import OLSKString from 'OLSKString'; import OLSKLanguageSwitcher from 'OLSKLanguageSwitcher'; -import OLSKFund from 'OLSKFund'; import OLSKVersion from 'OLSKVersion'; import OLSKLocalStorage from 'OLSKLocalStorage'; import OLSKPact from 'OLSKPact'; @@ -271,17 +270,6 @@ const mod = { }, }, { - LCHRecipeName: 'FakeFundDocumentLimit', - LCHRecipeCallback: async function FakeFundDocumentLimit () { - await Promise.all(Array.from(Array(mod._ValueDocumentRemainder)).map(function (e) { - return mod._ValueZDRWrap.App.KVCNote.KVCNoteCreate({ - KVCNoteBody: Math.random().toString(), - }); - })); - - return mod.SetupCatalog(); - }, - }, { LCHRecipeName: 'KVCWriteLauncherItemDebug_PromptFakeImportPlain', LCHRecipeCallback: function KVCWriteLauncherItemDebug_PromptFakeImportPlain () { return mod.ControlNotesImportTXT([Object.assign(new File([], Math.random().toString()), { @@ -327,16 +315,6 @@ const mod = { })); } - outputData.push(...OLSKFund.OLSKFundRecipes({ - OLSKLocalized, - ParamConnected: !!mod._ValueCloudIdentity, - ParamAuthorized: !!mod._ValueFundClue, - OLSKFundDispatchGrant: mod.OLSKFundDispatchGrant, - OLSKFundDispatchPersist: mod.OLSKFundDispatchPersist, - ParamMod: mod, - ParamSpecUI: OLSK_SPEC_UI(), - })); - outputData.push(...OLSKServiceWorker.OLSKServiceWorkerRecipes(window, mod.DataNavigator(), OLSKLocalized, OLSK_SPEC_UI())); if (mod._KVCWriteDetail) { @@ -360,16 +338,6 @@ const mod = { return `${ OLSKTransport.OLSKTransportExportBasename() }.zip`; }, - DataIsEligible (inputData = {}) { - return OLSKFund.OLSKFundIsEligible(Object.assign({ - ParamMinimumTier: 1, - ParamCurrentProject: 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN', - ParamBundleProjects: ['FakeBundleProject'], - ParamGrantTier: OLSKFund.OLSKFundTier('OLSK_FUND_PRICING_STRING_SWAP_TOKEN', mod._ValueOLSKFundGrant), - ParamGrantProject: mod._ValueOLSKFundGrant ? mod._ValueOLSKFundGrant.OLSKPactGrantProject : '', - }, inputData)); - }, - DataIsMobile () { return window.innerWidth <= 760; }, @@ -451,10 +419,6 @@ const mod = { }, async ControlNoteCreate(inputData) { - if (mod._ValueDocumentRemainder < 1 && !mod.DataIsEligible()) { - return mod.OLSKFundDocumentGate(); - } - mod.ControlNoteActivate(mod._OLSKCatalog.modPublic.OLSKCatalogInsert(await mod._ValueZDRWrap.App.KVCNote.KVCNoteCreate(typeof inputData === 'object' ? inputData : { KVCNoteBody: typeof inputData === 'string' ? inputData : '', }))); @@ -723,10 +687,6 @@ const mod = { mod.ControlNoteCreate(inputData + '\n\n'); }, - OLSKCatalogDispatchQuantity (inputData) { - mod.OLSKFundDocumentRemainder && mod.OLSKFundDocumentRemainder(inputData); - }, - OLSKAppToolbarDispatchApropos () { mod._OLSKModalView.modPublic.OLSKModalViewShow(); }, @@ -970,34 +930,6 @@ const mod = { mod._ValueZDRWrap.ZDRStorageClient().stopSync(); }, - OLSKFundSetupDispatchClue () { - return mod.DataSetting('KVCSettingFundClue') || null; - }, - - _OLSKFundSetupDispatchUpdate (inputData) { - mod[inputData] = mod[inputData]; // #purge-svelte-force-update - }, - - OLSKFundDispatchPersist (inputData) { - mod._ValueFundClue = inputData; // #hotfix-missing-persist - - if (!inputData) { - return mod._ValueZDRWrap.App.KVCSetting.ZDRModelDeleteObject({ - KVCSettingKey: 'KVCSettingFundClue', - }); - } - - return mod.ValueSetting('KVCSettingFundClue', inputData).then(function () { - if (OLSK_SPEC_UI()) { - return; - } - - setTimeout(function () { - window.location.reload(); - }, mod._ValueZDRWrap.ZDRStorageProtocol === zerodatawrap.ZDRProtocolFission() ? 1000 : 0); // #hotfix-fission-delay - }); - }, - // REACT ReactIsLoading (inputData) { @@ -1025,7 +957,7 @@ const mod = { mod.SetupValueVersionsMap(); - mod.SetupFund(); + mod.SetupCleanup(); mod.ReactIsLoading(mod._ValueIsLoading = false); @@ -1090,7 +1022,7 @@ const mod = { }; if (!(await mod._ValueZDRWrap.App.KVCNote.KVCNoteList()).map(mod._OLSKCatalog.modPublic.OLSKCatalogInsert).length) { - mod.OLSKCatalogDispatchQuantity(0); + // mod.OLSKCatalogDispatchQuantity(0); } }, @@ -1104,50 +1036,12 @@ const mod = { mod._ValueVersionMap = OLSKLocalStorage.OLKSLocalStorageGet(window.localStorage, 'KVC_VERSION_MAP') || {}; }, - async SetupFund () { - OLSKFund.OLSKFundSetup({ - ParamMod: mod, - OLSKLocalized, - ParamFormURL: 'OLSK_FUND_FORM_URL_SWAP_TOKEN', - ParamProject: 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN', - ParamSpecUI: OLSK_SPEC_UI(), - ParamDocumentLimit: parseInt('OLSK_FUND_DOCUMENT_LIMIT_SWAP_TOKEN'), - }); - - mod.OLSKFundDocumentRemainder(mod._OLSKCatalog.modPublic._OLSKCatalogDataItemsAll().length); + SetupCleanup() { + window.localStorage.removeItem('OLSK_FUND_GRANT_DATA'); - await OLSKFund.OLSKFundSetupPostPay(mod); - - if (!mod._ValueCloudIdentity) { - return; - } - - if (!mod._ValueFundClue) { - return; - } - - const item = { - OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE: `OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN${ '' }`, // #purge - OLSK_CRYPTO_PAIR_SENDER_PUBLIC: 'OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN', - OLSK_FUND_API_URL: 'OLSK_FUND_API_URL_SWAP_TOKEN', - ParamBody: { - OLSKPactAuthType: mod._ValueZDRWrap.ZDRStorageProtocol === zerodatawrap.ZDRProtocolRemoteStorage() ? OLSKPact.OLSKPactAuthTypeRemoteStorage() : OLSKPact.OLSKPactAuthTypeFission(), - OLSKPactAuthIdentity: mod._ValueCloudIdentity, - OLSKPactAuthProof: mod._ValueCloudToken, - OLSKPactAuthMetadata: { - OLSKPactAuthMetadataModuleName: 'wikiavec', - OLSKPactAuthMetadataFolderPath: KVCNote.KVCNoteDirectory() + '/', - }, - OLSKPactPayIdentity: mod._ValueCloudIdentity, - OLSKPactPayClue: mod._ValueFundClue, - }, - OLSKLocalized, - OLSKFundDispatchProgress: mod.OLSKFundDispatchProgress, - OLSKFundDispatchFail: mod.OLSKFundDispatchFail, - OLSKFundDispatchGrant: mod.OLSKFundDispatchGrant, - }; - - return OLSKFund.OLSKFundSetupGrant(item); + return mod._ValueSettingsAll.KVCSettingFundClue && mod._ValueZDRWrap.App.KVCSetting.ZDRModelDeleteObject({ + KVCSettingKey: 'KVCSettingFundClue', + }); }, // LIFECYCLE @@ -1201,7 +1095,6 @@ import OLSKUIAssets from 'OLSKUIAssets'; OLSKCatalogDispatchArchivedHide={ mod.OLSKCatalogDispatchArchivedHide } OLSKCatalogDispatchArchivedShow={ mod.OLSKCatalogDispatchArchivedShow } OLSKCatalogDispatchFilterSubmit={ mod.OLSKCatalogDispatchFilterSubmit } - OLSKCatalogDispatchQuantity={ mod.OLSKCatalogDispatchQuantity } let:OLSKCollectionItem > @@ -1296,13 +1189,10 @@ import OLSKUIAssets from 'OLSKUIAssets'; OLSKAppToolbarDispatchApropos={ mod.OLSKAppToolbarDispatchApropos } OLSKAppToolbarDispatchTongue={ mod.OLSKAppToolbarDispatchTongue } OLSKAppToolbarGuideURL={ window.OLSKCanonical('KVCGuideRoute') } - OLSKAppToolbarFundShowProgress={ mod._ValueOLSKFundProgress } - OLSKAppToolbarFundLimitText={ mod._ValueDocumentRemainder } OLSKAppToolbarErrorText={ mod._OLSKAppToolbarErrorText } OLSKAppToolbarCloudConnected={ !!mod._ValueCloudIdentity } OLSKAppToolbarCloudOffline={ mod._ValueCloudIsOffline } OLSKAppToolbarCloudError={ !!mod._ValueCloudErrorText } - OLSKAppToolbarDispatchFund={ mod._ValueOLSKFundGrant || OLSKFund.OLSKFundResponseIsPresent() ? null : mod.OLSKAppToolbarDispatchFund } OLSKAppToolbarDispatchCloud={ mod.OLSKAppToolbarDispatchCloud } OLSKAppToolbarDispatchLauncher={ mod.OLSKAppToolbarDispatchLauncher } /> @@ -1316,13 +1206,9 @@ import OLSKUIAssets from 'OLSKUIAssets'; -{#if !!mod._ValueCloudIdentity } - -{/if} - diff --git a/os-app/open-write/ui-test-fund.js b/os-app/open-write/ui-test-fund.js deleted file mode 100644 index 7e69e374..00000000 --- a/os-app/open-write/ui-test-fund.js +++ /dev/null @@ -1,33 +0,0 @@ -const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); - -describe('KVCWrite_Fund', function () { - - require('OLSKFund/ui-test_template').default({ - - kDefaultRoute, - - ParamProject: process.env.ROCO_SHARED_PROJECT_ID, - - ParamTriggerGate () { - return browser.pressButton('.KVCWriteCreateButton'); - }, - - ParamCreateDocument () { - return browser.pressButton('.KVCWriteCreateButton'); - }, - - async ParamDeleteDocument () { - await browser.click('.OLSKCollectionItem'); - - return browser.OLSKConfirm(function () { - return browser.pressButton('.KVCWriteDetailToolbarDiscardButton'); - }); - }, - - ParamCreateDocumentSync () { - return browser.OLSKLauncherRun('FakeZDRSchemaDispatchSyncCreateNote'); - }, - - }); - -}); diff --git a/package.json b/package.json index 2b17e356..53702a09 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "OLSKPithApp": "olsk/OLSKPithApp", "OLSKCatalog": "olsk/OLSKCatalog", - "marked": "latest", + "marked": "5.x", "escape-string-regexp": "4.x", "OLSKVersion": "olsk/OLSKVersion", "OLSKLocalStorage": "olsk/OLSKLocalStorage", diff --git a/rollup-config.js b/rollup-config.js index 45e866a3..935c8a2d 100644 --- a/rollup-config.js +++ b/rollup-config.js @@ -7,11 +7,6 @@ export default require('OLSKRollupScaffold').OLSKRollupScaffoldScanStart(__dirna KVC_TEMPLATE_NORMALIZE_URL_SWAP_TOKEN: process.env.KVC_TEMPLATE_NORMALIZE_URL, KVC_TEMPLATE_DECOR_URL_SWAP_TOKEN: process.env.KVC_TEMPLATE_DECOR_URL, - OLSK_FUND_API_URL_SWAP_TOKEN: process.env.OLSK_FUND_API_URL, - OLSK_FUND_FORM_URL_SWAP_TOKEN: process.env.OLSK_FUND_FORM_URL, - OLSK_FUND_PRICING_STRING_SWAP_TOKEN: process.env.OLSK_FUND_PRICING_STRING, - OLSK_FUND_DOCUMENT_LIMIT_SWAP_TOKEN: process.env.OLSK_FUND_DOCUMENT_LIMIT, - OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE, OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_SENDER_PUBLIC,