diff --git a/front/package-lock.json b/front/package-lock.json index 19ea106..2d72474 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -7,6 +7,9 @@ "": { "name": "my-webpack-project", "version": "1.0.0", + "dependencies": { + "request": "^2.79.0" + }, "devDependencies": { "@babel/core": "^7.20.2", "@babel/preset-env": "^7.20.2", @@ -3094,12 +3097,46 @@ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha512-u1L0ZLywRziOVjUhRxI0Qg9G+4RnFB9H/Rq40YWn0dieDgO7vAYeJz6jKAO6t/aruzlDFLAPkQTT87e+f8Imaw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/async": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha512-JnJpAS0p9RmixkOvW2XwDxxzs1bd4/VAGIl6Q0EC5YOo+p+hqIhtDhn/nmFnB/xUNXbLkpE2mOjgVIBRKD4xYw==", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + }, "node_modules/babel-loader": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.0.tgz", @@ -3250,6 +3287,14 @@ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, "node_modules/before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", @@ -3388,6 +3433,18 @@ "multicast-dns": "^7.2.5" } }, + "node_modules/boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha512-KbiZEa9/vofNcVJXGwdWWn25reQ3V3dHBWbS07FTF3/TOehLnm9GEhJV4T6ZvGPkShRpmUqYwnaCrkj0mRnP6Q==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dependencies": { + "hoek": "2.x.x" + }, + "engines": { + "node": ">=0.10.40" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3569,6 +3626,11 @@ } ] }, + "node_modules/caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha512-ODLXH644w9C2fMPAm7bMDQ3GRvipZWZfKc+8As6hIadRIelE0n0xZuN38NS6kiK3KPEVrpymmQD8bvncAHWQkQ==" + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3835,11 +3897,21 @@ "node": ">=0.1.90" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/common-ancestor-path": { "version": "1.0.1", @@ -4012,6 +4084,18 @@ "node": ">= 8" } }, + "node_modules/cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha512-FFN5KwpvvQTTS5hWPxrU8/QE4kQUc6uwZcrnlMBN82t1MgAtq8mnoDwINBly9Tdr02seeIIhtdF+UH1feBYGog==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dependencies": { + "boom": "2.x.x" + }, + "engines": { + "node": ">=0.10.40" + } + }, "node_modules/css-loader": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.2.tgz", @@ -4059,6 +4143,25 @@ "node": ">=8" } }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dashdash/node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -4146,6 +4249,14 @@ "node": ">=8" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -4238,6 +4349,15 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -4594,6 +4714,11 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -4608,6 +4733,14 @@ "node": ">=4" } }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ] + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -4895,6 +5028,27 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha512-8HWGSLAPr+AG0hBpsqi5Ob8HrLStN/LWeqhpFl14d7FJgHK48TmgLoALPz69XSUR65YJzDfLUX/BM8+MLJLghQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -4977,6 +5131,22 @@ "node": ">=10" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ==", + "dependencies": { + "is-property": "^1.0.0" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5013,6 +5183,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/getpass/node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/github-username": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/github-username/-/github-username-6.0.0.tgz", @@ -5136,6 +5322,82 @@ "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", "dev": true }, + "node_modules/har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha512-P6tFV+wCcUL3nbyTDAvveDySfbhy0XkDtAIfZP6HITjM2WUsiPna/Eg1Yy93SFXvahqoX+kt0n+6xlXKDXYowA==", + "deprecated": "this library is no longer supported", + "dependencies": { + "chalk": "^1.1.1", + "commander": "^2.9.0", + "is-my-json-valid": "^2.12.4", + "pinkie-promise": "^2.0.0" + }, + "bin": { + "har-validator": "bin/har-validator" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/har-validator/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/har-validator/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/har-validator/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/har-validator/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/har-validator/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/har-validator/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5148,6 +5410,25 @@ "node": ">= 0.4.0" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5187,6 +5468,30 @@ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, + "node_modules/hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha512-X8xbmTc1cbPXcQV4WkLcRMALuyoxhfpFATmyuCxJPOAvrDS4DNnsTAOmKUxMTOWU6TzrTOkxPKwIx5ZOpJVSrg==", + "deprecated": "This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dependencies": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + }, + "engines": { + "node": ">=0.10.32" + } + }, + "node_modules/hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha512-V6Yw1rIcYV/4JsnggjBU0l4Kr+EXhpwqXRusENU1Xx6ro00IHPHYNynCuBTOZAPlr3AAmLvchH9I7N/VUdvOwQ==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "engines": { + "node": ">=0.10.40" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -5345,6 +5650,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha512-iUn0NcRULlDGtqNLN1Jxmzayk8ogm7NToldASyZBpM2qggbphjXzNOiw3piN8tgz+e/DRs6X5gAzFwTI6BCRcg==", + "dependencies": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -5653,6 +5972,23 @@ "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", "dev": true }, + "node_modules/is-my-ip-valid": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz", + "integrity": "sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==" + }, + "node_modules/is-my-json-valid": { + "version": "2.20.6", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz", + "integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==", + "dependencies": { + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", + "jsonpointer": "^5.0.0", + "xtend": "^4.0.0" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -5683,6 +6019,11 @@ "node": ">=0.10.0" } }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, "node_modules/is-scoped": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-scoped/-/is-scoped-2.1.0.tgz", @@ -5707,6 +6048,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -5776,6 +6122,11 @@ "node": ">=0.10.0" } }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + }, "node_modules/jackspeak": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", @@ -5845,6 +6196,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5863,6 +6219,11 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -5878,6 +6239,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -5899,6 +6265,36 @@ "node >= 0.2.0" ] }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/jsprim/node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/just-diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz", @@ -6326,7 +6722,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -6335,7 +6730,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -7200,6 +7594,14 @@ "set-blocking": "^2.0.0" } }, + "node_modules/oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha512-VlF07iu3VV3+BTXj43Nmp6Irt/G7j/NgEctUS6IweH1RGhURjjCc2NWtzXFPXXWWfc7hgbXQdtiQu2LGp6MxUg==", + "engines": { + "node": "*" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -7633,6 +8035,25 @@ "node": ">=0.10.0" } }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -8377,6 +8798,54 @@ "node": ">= 0.10" } }, + "node_modules/request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha512-e7MIJshe1eZAmRqg4ryaO0N9G0fs+/gpDe5FlbnIFy6zZznRSwdRFrLp63if0Yt43vrI5wowOqHv1qJdVocdOQ==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dependencies": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~2.0.6", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "qs": "~6.3.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "~0.4.1", + "uuid": "^3.0.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.3.tgz", + "integrity": "sha512-f8CQ/sKJBr9vfNJBdGiPzTSPUufuWyvOFkCYJKN9voqPWuBuhdlSZM78dOHKigtZ0BwuktYGrRFW2DXXc/f2Fg==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -8561,8 +9030,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { "version": "1.2.4", @@ -9164,6 +9632,18 @@ "npm": ">= 3.0.0" } }, + "node_modules/sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha512-7bgVOAnPj3XjrKY577S+puCKGCRlUrcrEdsMeRXlg9Ghf5df/xNi6sONUa43WrHUd3TjJBF7O04jYoiY0FVa0A==", + "deprecated": "This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dependencies": { + "hoek": "2.x.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -9328,6 +9808,38 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, + "node_modules/sshpk": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sshpk/node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", @@ -9387,6 +9899,11 @@ "node": ">=8" } }, + "node_modules/stringstream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==" + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -9660,6 +10177,22 @@ "node": ">=0.6" } }, + "node_modules/tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dependencies": { + "punycode": "^1.4.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -9919,6 +10452,19 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha512-e0IoVDWx8SDHc/hwFTqJDQ7CCDTEeGhmcT9jkWJjoGQSpgBz20nAMr80E3Tpk7PatJ1b37DQDgJR3CNSzcMOZQ==", + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", @@ -10117,6 +10663,32 @@ "node": ">= 0.8" } }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror/node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + }, "node_modules/vinyl": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", @@ -10651,6 +11223,14 @@ } } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/front/package.json b/front/package.json index 14f028a..7af1f62 100644 --- a/front/package.json +++ b/front/package.json @@ -13,6 +13,7 @@ "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.11.1" }, + "type": "module", "version": "1.0.0", "description": "My webpack project", "name": "my-webpack-project", @@ -23,5 +24,8 @@ "watch": "webpack --watch", "watch:prod": "webpack --watch --mode=production --node-env=production", "serve": "webpack serve" + }, + "dependencies": { + "request": "^2.79.0" } } diff --git a/front/src/apps/finder/finder-window.js b/front/src/apps/finder/finder-window.js index 603de97..bcf4665 100644 --- a/front/src/apps/finder/finder-window.js +++ b/front/src/apps/finder/finder-window.js @@ -1,34 +1,51 @@ +// import WebDesktopEnvironment from "../../wde/wde-desktop" + +// import Finder from "./finder" + +// import WebDesktopEnvironment from "../../wde/wde-desktop" export default class FinderWindow{ + #appId = "Finder" //FIXME curPath = "" fileView = undefined windowElem = undefined + /** @type {WebDesktopEnvironment} */ + #wde + #finder - async Init(args, appContext){ + /** + * @param {Finder} finder + * @param {*} args + * @param {import("../../wde/wde-desktop").runContext} runContext + * @returns + */ + async Init(finder, args, runContext){ + this.#finder = finder + this.#wde = runContext.WDE if (args[1] == "--desktop"){ let desktopNode = document.body.querySelector(`#${args[2]}`) if (desktopNode == null){ - WebDesktopEnvironment.Alert("Desktop node not found") + this.#wde.Alert("Desktop node not found") return } const params = new URLSearchParams({ path: args[0] }) - const response = await fetch(`/app/${Finder.AppId}/renderDesktop?` + params, + const response = await fetch(`/app/${this.#appId}/renderDesktop?` + params, { method: "POST", - body: JSON.stringify(appContext) + body: JSON.stringify(runContext) }) if (response.status != 200){ console.log(response.status) - WebDesktopEnvironment.Alert("Error in render desktop") //TODO + this.#wde.Alert("Error in render desktop") //TODO return } const html = await response.text() desktopNode.innerHTML = html - - this.fileView = new FileView( + + this.fileView = new runContext.WDE.FileView( desktopNode.querySelector(".FileTileView"), (event) =>{this.Click(event)}, (event) => { this.RightClick(event) }, (event, draggedElem) => { this.DropEvent(event, draggedElem)}, @@ -37,23 +54,25 @@ export default class FinderWindow{ this.RenderDir(args[0]) return } - const params = new URLSearchParams({isMobile: WebDesktopEnvironment.isMobile}) - const response = await fetch(`/app/${Finder.AppId}/render?` + params, + const params = new URLSearchParams({isMobile: false}) //FIXME + const response = await fetch(`/app/${this.#appId}/render?` + params, { method: "POST", - body: JSON.stringify(appContext) + body: JSON.stringify(runContext) }) if (response.status != 200){ const error = await response.json() - WebDesktopEnvironment.Alert(error.message) + this.#wde.Alert(error.message) return } const html = await response.text() - let newWindow = WebDesktopEnvironment.CreateNewWindow(Finder.AppId, 500, 350 ) + let newWindow = this.#wde.Decorat.CreateNewWindow(this.#appId, 500, 350 ) newWindow.innerHTML = html - this.fileView = new FileView( + // console.log(this.#wde) + + this.fileView = new runContext.WDE.FileView( newWindow.querySelector(".FileTileView"), (event) => { this.Click(event) }, (event) => { this.RightClick(event) }, @@ -61,10 +80,8 @@ export default class FinderWindow{ () => { this.ReRenderDir() } ) - newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) { - - WebDesktopEnvironment.CloseWindow(newWindow) - + newWindow.querySelector("#closeWindowButton").addEventListener('click', () => { + this.#wde.Decorat.CloseWindow(newWindow) }) newWindow.querySelector("#RootButton").addEventListener('click', () =>{ @@ -75,7 +92,7 @@ export default class FinderWindow{ this.RenderDir('/home/user') }) - let scrollBar = new WdeScrollBar(newWindow.querySelector(".ScrollbarPlace"), newWindow.querySelector(".FileTileView")) + let scrollBar = new this.#wde.ScrollBar(newWindow.querySelector(".ScrollbarPlace"), newWindow.querySelector(".FileTileView")) this.windowElem = newWindow this.RenderDir(args[0]) @@ -106,7 +123,7 @@ export default class FinderWindow{ if (res){ this.ReRenderDir() } else { - WebDesktopEnvironment.Alert("UWAGA TODO MOVE FILE ERROR") //TODO + this.#wde.Alert("UWAGA TODO MOVE FILE ERROR") //TODO } } else { console.log(event, this.curPath) @@ -120,7 +137,7 @@ export default class FinderWindow{ this.ReRenderDir() } } - return + const params = new URLSearchParams({ parentPath: this.curPath, }) @@ -130,7 +147,7 @@ export default class FinderWindow{ body: formData }) if (response.status != 200){ - WebDesktopEnvironment.Alert("ERROR IN UPLOADING FILE")//TODO + this.#wde.Alert("ERROR IN UPLOADING FILE")//TODO } else { this.ReRenderDir() } @@ -156,7 +173,7 @@ export default class FinderWindow{ switch (true) { case fileType == "objectlink": - WebDesktopEnvironment.Alert("Links not supported yet") + this.#wde.Alert("Links not supported yet") break case fileType == "pathlink": let res = await WebFS.ReadPathLink(`${parentPath}/${fileName}`) @@ -164,22 +181,22 @@ export default class FinderWindow{ this.OpenFile(res.parentPath, res.name, res.filetype) break case fileExtension == "app": - WebDesktopEnvironment.Open(`${parentPath}/${fileName}`, []) + this.#wde.Open(`${parentPath}/${fileName}`, []) break case fileExtension == "blog": - WebDesktopEnvironment.Open(`/Applications/BlogViewer.app`, [`${parentPath}/${fileName}`]) + this.#wde.Open(`/Applications/BlogViewer.app`, [`${parentPath}/${fileName}`]) break case fileType == "directory": - WebDesktopEnvironment.Open(`/Applications/Finder.app`, [`${parentPath}/${fileName}`]) + this.#wde.Open(`/Applications/Finder.app`, [`${parentPath}/${fileName}`]) break case fileExtension == "blog": - WebDesktopEnvironment.Open("/Applications/BlogViewer.app", [`${parentPath}/${fileName}`]) + this.#wde.Open("/Applications/BlogViewer.app", [`${parentPath}/${fileName}`]) break case fileExtension == "jpeg" | fileExtension == "png": - WebDesktopEnvironment.Open("img-viewer", [`${parentPath}/${fileName}`]) + this.#wde.Open("img-viewer", [`${parentPath}/${fileName}`]) break; default: - WebDesktopEnvironment.Alert("Unsupported file type") + this.#wde.Alert("Unsupported file type") break; } } @@ -212,9 +229,9 @@ export default class FinderWindow{ path = `${this.curPath}/${fileName}` } const params = new URLSearchParams({context: context, path: path}) - const response = await fetch(`/app/${Finder.AppId}/contextMenu?` + params) + const response = await fetch(`/app/${this.#appId}/contextMenu?` + params) if (response.status != 200){ - WebDesktopEnvironment.Alert("ERROR in Context menu TODO"); //TODO + this.#wde.Alert("ERROR in Context menu TODO"); //TODO return } const html = await response.text() @@ -265,7 +282,7 @@ export default class FinderWindow{ Finder.RenderProperites(path) break case "openAsDir": - WebDesktopEnvironment.Open(`/Applications/${Finder.AppId}.app`,[`${this.curPath}/${fileName}`]) + this.#wde.Open(`/Applications/${this.#appId}.app`,[`${this.curPath}/${fileName}`]) break default: break; diff --git a/front/src/apps/finder/finder.js b/front/src/apps/finder/finder.js index 7ebc9f2..8881b93 100644 --- a/front/src/apps/finder/finder.js +++ b/front/src/apps/finder/finder.js @@ -1,23 +1,38 @@ -require("./finder.less") +// require("./finder.less") -import FinderWindow from "./finder-window" +import WDEApplication from "../../wde/application.js" +import WebDesktopEnvironment from "../../wde/wde-desktop.js" +import FinderWindow from "./finder-window.js" -class Finder{ +export default class Finder extends WDEApplication{ static AppId = "Finder" + /** + * @constructor + * @param {WebDesktopEnvironment} wde + */ + constructor(wde){ + /** @type {WDEApplication} */ + super(wde) + } + /** * @param {string[]} args + * @param {import("../../wde/wde-desktop.js").runContext} */ async NewWindow(args, runContext){ let newFinder = new FinderWindow() - await newFinder.Init(args, runContext) + await newFinder.Init(this, args, runContext) + } /** * @param {string} path * @returns {boolean} */ - static async RenderProperites(path){ + async RenderProperites(path){ + + // return if (path == null || path ==""){ return } @@ -26,15 +41,15 @@ class Finder{ }) const response = await fetch(`/app/${Finder.AppId}/renderProps?` + params) if (response.status != 200){ - WebDesktopEnvironment.Alert("Error in properties render") //TODO + // WebDesktopEnvironment.Alert("Error in properties render") //TODO return false } const html = await response.text() - let newWindow = WebDesktopEnvironment.CreateNewWindow(Finder.AppId, 350, 500 ) + + let newWindow = super.getWde().Decorat.CreateNewWindow(Finder.AppId, 350, 500 ) newWindow.innerHTML = html newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) { - WebDesktopEnvironment.CloseWindow(newWindow) + // WebDesktopEnvironment.CloseWindow(newWindow) }) } -} - +} \ No newline at end of file diff --git a/front/src/desktop.js b/front/src/desktop.js index a76be5b..1ccfb8e 100644 --- a/front/src/desktop.js +++ b/front/src/desktop.js @@ -1,4 +1,4 @@ -import WebDesktopEnvironment from "./wde/wde-desktop"; +import WebDesktopEnvironment from "./wde/wde-desktop.js"; document.addEventListener('DOMContentLoaded', function() { let wde = new WebDesktopEnvironment() }, false); diff --git a/front/src/desktop.less b/front/src/desktop.less index ba34f22..a89a29c 100644 --- a/front/src/desktop.less +++ b/front/src/desktop.less @@ -1 +1,79 @@ -@import "./wde/sunboard/sunboard-desktop.less"; \ No newline at end of file +@import "./wde/primitives.less"; +@import "./wde/widgets/file-view/file-view.less"; +@import "./wde/legacy-ui.less"; +@import "./wde/widgets/basic-widgets.less"; +@import "./theme.less"; + +// @font-face{ +// font-family: "Virtue"; +// src:url("/res/dev-fs/fonts/virtue.ttf"); +// } + +/* @font-face{ + font-family: "Virtue"; + src:url("/res/dev-fs/fonts/virtue.ttf") +} */ + +/* @media screen and (max-device-width: 2048px) and (max-device-height: 2048px) { + html { + zoom: 3 + } + } */ + +.NoClick { + pointer-events: none; +} +.Click { + pointer-events: all; +} +*{ + font-family: Verdana, Geneva, sans-serif; + font-size: 11px; + font-style: normal; + font-weight:initial; +} + +*::-webkit-scrollbar { /* WebKit */ + width: 0; + height: 0; +} + +body{ + zoom: var(--zoom); + position: absolute; + width: 100%; + height: 100%; + margin: 0px; + + /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome, Edge, Opera and Firefox */ + touch-action: manipulation; +} + +#applications{ + position: static; + width: 0px; + height: 0px; + visibility: hidden; +} + +#windows-layer { + width: 0px; + height: 0px; + /* position: fixed; */ + position: static; +} + +#desktop-layer{ + position: fixed; + /* margin: 0px; */ + width: 100%; + height: 100%; + background-color: @col-ceil; +} \ No newline at end of file diff --git a/front/src/init.js b/front/src/init.js deleted file mode 100644 index f59702f..0000000 --- a/front/src/init.js +++ /dev/null @@ -1,6 +0,0 @@ -document.addEventListener('DOMContentLoaded', function() { - console.log("init") - -}, false); - - diff --git a/front/src/init.mjs b/front/src/init.mjs new file mode 100644 index 0000000..b66d08d --- /dev/null +++ b/front/src/init.mjs @@ -0,0 +1,3 @@ +export default class Kek{ + +} \ No newline at end of file diff --git a/front/src/wde/application.js b/front/src/wde/application.js new file mode 100644 index 0000000..3d7065d --- /dev/null +++ b/front/src/wde/application.js @@ -0,0 +1,18 @@ +import WebDesktopEnvironment from "./wde-desktop.js" + +export default class WDEApplication{ + /** @type {WebDesktopEnvironment} */ + #wde + + /** + * @constructor + * @param {WebDesktopEnvironment} wde + */ + constructor(wde){ + this.#wde = wde + } + + getWde(){ + return this.#wde + } +} \ No newline at end of file diff --git a/front/src/decorat/desktop-decorat.js b/front/src/wde/decorat/desktop-decorat.js similarity index 54% rename from front/src/decorat/desktop-decorat.js rename to front/src/wde/decorat/desktop-decorat.js index 912d68c..cc24f5d 100644 --- a/front/src/decorat/desktop-decorat.js +++ b/front/src/wde/decorat/desktop-decorat.js @@ -6,9 +6,9 @@ export default class DesktopDecorat{ this.windowLayer = document.body.querySelector('#windows-layer') // this.#windowsLayer = document.body.querySelector('#windows-layer') this.#windowsLayer = document.body.querySelector('#windows-layer') - let startDrag = function(event) { + let startDrag = (event) => { let window = event.target.closest('.WindowFrame') - DesktopDecorat.bringWindowToFront(window) + this.bringWindowToFront(window) if (event.target.classList.contains("DragArea")){ let xPosInit = event.offsetX let yPosInit = event.offsetY @@ -28,10 +28,11 @@ export default class DesktopDecorat{ this.#windowsLayer.addEventListener('mousedown', startDrag) } + /** * @param {HTMLElement} window */ - static bringWindowToFront(window){ //FIXME + bringWindowToFront(window){ //FIXME let previousWindow = this.#windowsLayer.lastChild if (window == null || window == undefined){ return @@ -46,9 +47,58 @@ export default class DesktopDecorat{ return } + /** + * @param {string} appId + * @param {number} width + * @param {number} height + * @returns {HTMLElement} + */ + CreateNewWindow(appId, width, height) { + let newWindow = document.createElement("div") + newWindow.setAttribute('appid', appId) + + newWindow.setAttribute("class", "WindowFrame ConvexElement") + newWindow.setAttribute("windowId", this.#makeid(4)) //TODO: + + newWindow.style.width = width.toString() + "px" + newWindow.style.height = height.toString() + "px" + + document.body.querySelector('#windows-layer').appendChild(newWindow) + return newWindow + + } + + /** + * @param {HTMLElement} window + */ + CloseWindow(window) { + window.remove() + } + + CloseFocusedWindow() { + if (document.body.querySelector('#windows-layer').childElementCount > 1){ + document.body.querySelector('#windows-layer').lastElementChild.remove() + } + } + static ChangeURL(appWindow){ let appId = appWindow.getAttribute('appid') window.history.replaceState(null, "", `/${appId}/`); } + + /** + * @param {num} length + */ + #makeid(length) { + let result = ''; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const charactersLength = characters.length; + let counter = 0; + while (counter < length) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + counter += 1; + } + return result; + } } \ No newline at end of file diff --git a/front/src/decorat/mobile-decorat.js b/front/src/wde/decorat/mobile-decorat.js similarity index 100% rename from front/src/decorat/mobile-decorat.js rename to front/src/wde/decorat/mobile-decorat.js diff --git a/front/src/wde/legacy-ui.less b/front/src/wde/legacy-ui.less new file mode 100644 index 0000000..5c13eb5 --- /dev/null +++ b/front/src/wde/legacy-ui.less @@ -0,0 +1,232 @@ +.WindowFrame { + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + padding: 4px; + padding-top: 2px; + padding-right: 6px; + gap: 4px; + + position: absolute; + + background: #DDDDDD; + border: 1px solid #555555; + + + /* Inside auto layout */ + flex: none; + order: 1; + align-self: stretch; + flex-grow: 1; +} + +/* TODO Add shadows to windows */ +.WindowFrame.Focused{ + border: 1px solid #000000; + background-color: #CCCCCC; +} + +.WindowFrameShadow { + box-shadow: 2px 2px 0px #555555; +} + +/* FIXME Not work on context menu */ +.WindowFrameShadow.Focused { + box-shadow: 2px 2px 0px #000000; +} + +.ConvexElement.Focused { + box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25), + inset -1px -1px 0px rgba(0, 0, 0, 0.27), + inset 1px 1px 0px #FFFFFF; +} + +.AdjectiveElement { + border: 1px solid #555555; +} + +.Focused .AdjectiveElement { + border: 1px solid #000000; + box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25), + 1px 1px 0px #FFFFFF; + /* inset -1px -1px 0px rgba(0, 0, 0, 0.27), */ + /* inset 1px 1px 0px #FFFFFF;*/ +} + +.AdjectiveHorizontalLine { + border-top: 1px solid rgba(0, 0, 0, 0.25); + border-bottom: 1px solid #FFFFFF; + width: 100%; + height: 0px; +} + +.AdjectiveHorizontalLine:last-child { + height: 0%; + visibility: hidden; +} + + +.WindowFrame .TitleBar { + width: 100%; + height: 13px; + + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 5px; + padding: 0px; + + + /* Inside auto layout */ + flex: none; + order: 0; + align-self: stretch; + flex-grow: 0; +} + +.WindowFrame .TitleBar .Lable { + position: relative; + top: 1px; + /* font-size: 13px; */ + color:#777777; + pointer-events: none; + white-space: nowrap; + + font-family: "Virtue"; + letter-spacing: 0.35px; +} + +.WindowFrame.Focused .TitleBar .Lable { + color:#000000; +} + + +.WindowFrame .TitleBar .Button { + width: 11px; + height: 11px; + padding: 0%; + position: relative; + top: 1px; + visibility: hidden; + + background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%); + border: 1px solid #222222; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, + -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), + inset 1px 1px 0px rgba(255, 255, 255, 0.5), + inset -1px -1px 0px rgba(0, 0, 0, 0.27); + /* Inside auto layout */ + flex: none; + order: 0; + flex-grow: 0; +} + +.WindowFrame.Focused .TitleBar .Button { + visibility: visible; +} + +.WindowFrame .TitleBar .Button:active { + background-color: rgba(0, 0, 0, 0.4); + /* Green */ + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, + -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25); +} + +.Focused .VisualDragArea { + pointer-events: none; + width: 100%; + height: 11px; + background: linear-gradient(transparent 0%, white 0%, white 50%, transparent 50%); + background-size: 2px 2px; + filter: drop-shadow(1px 1px 0px #777777); +} + +.MobileContentBorder { + width: 100%; + height: 100%; + background-color: #DDDDDD; + /* border: 1px solid #000000; */ + + /* box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25), + 1px 1px 0px #FFFFFF, + inset -1px -1px 0px rgba(0, 0, 0, 0.27), + inset 1px 1px 0px #FFFFFF; */ + + overflow: hidden; + overflow-x: hidden; + + /* Auto layout */ + display: flex; + flex-direction: row; + justify-content: center; + align-items: flex-start; + padding: 0px; +} + +.MobileApplicationWindow { + width: 100%; + height: 100%; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + + position: absolute; + top: 0px; + left: 0px; +} + +.MobileWindowFrameBottomBar { + width: 100%; + height: 20px; + /* + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + gap: 5px; + padding: 0px; */ + + /* Inside auto layout */ + flex: none; + order: 0; + align-self: stretch; + flex-grow: 0; +} + +.MobileWindowFrameBottomBarButton { + min-width: 11px; + width: auto; + height: 15px; + padding: 0px 4px 0px 4px; + position: absolute; + right: 4px; + + background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%); + border: 1px solid #222222; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, + -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), + inset 1px 1px 0px rgba(255, 255, 255, 0.5), + inset -1px -1px 0px rgba(0, 0, 0, 0.27); + + /* Inside auto layout */ + flex: none; + order: 0; + flex-grow: 0; +} + +.MobileWindowFrameBottomBar .MobileLable { + position: absolute; + /* top:1px; */ + /* font-size: 13px; */ + left: 50%; + pointer-events: none; + white-space: nowrap; + + font-family: "Virtue"; + letter-spacing: 0.35px; + +} \ No newline at end of file diff --git a/front/src/wde/wde-desktop.js b/front/src/wde/wde-desktop.js index 72c9344..031e0a9 100644 --- a/front/src/wde/wde-desktop.js +++ b/front/src/wde/wde-desktop.js @@ -1,28 +1,37 @@ -import DesktopDecorat from "../decorat/desktop-decorat"; -import WdeScrollBar from "./scrollbar/scrollbar"; -import WebFS from "../web-fs/web-fs"; -// import DesktopSunBoard from "./sunboard/sunboard-desktop"; +import DesktopDecorat from "./decorat/desktop-decorat.js"; +import WDEScrollBar from "./scrollbar/scrollbar.js"; +import WebFS from "../web-fs/web-fs.js"; +import WDEApplication from "./application.js"; +import WDEFileView from "./widgets/file-view/file-view.js"; + +// import DesktopSunBoard from "./sunboard/sunboard-desktop.js"; export default class WebDesktopEnvironment{ + /** @type {string} */ + test = "" + /** @type {WDEFileView} */ + FileView = WDEFileView + /** @type {WDEScrollBar} */ + ScrollBar = WDEScrollBar /**@type {DesktopDecorat} */ - #decorat + Decorat + /** @type {Object} */ static Applications = {}; + /** Deprecated */ static isMobile = false // static decorat static webFs constructor(){ document.body.style.setProperty('--zoom', 1) - this.#decorat = new DesktopDecorat() - - WebDesktopEnvironment.webFs = new WebFS() - // this.loadWDE() - this.#devLoadSunboard() - } + this.Decorat = new DesktopDecorat() - async #devLoadSunboard(){ - // let sunBoard = new DesktopSunBoard() + WebDesktopEnvironment.webFs = new WebFS() + this.FileView = WDEFileView + this.loadWDE() + // this.#devLoadSunboard() } async loadWDE(){ + let autoStart = document.body.querySelector("wde-autostart") if (autoStart == null){ WebDesktopEnvironment.Alert("Error in loading DE") @@ -44,7 +53,7 @@ export default class WebDesktopEnvironment{ } // console.log(appPath, args) - await WebDesktopEnvironment.Open(appPath, args) + await this.Open(appPath, args) } autoStart.remove() } @@ -54,15 +63,19 @@ export default class WebDesktopEnvironment{ * @param {string[]} args * @param {string} runPath */ - static async Open(appPath, args, runPath){ + async Open(appPath, args, runPath){ const appManifest = await WebDesktopEnvironment.fetchApp(appPath) + if (appManifest === undefined) return //TODO return err + /**@type {runContext} */ const runContext = { + WDE: this, isMobile: false, bundlePath: appPath, - runPath: runPath //TODO + runPath: runPath } + if (WebDesktopEnvironment.Applications[appManifest.appId] === undefined){ WebDesktopEnvironment.load2(appManifest, () =>{ WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext) @@ -79,22 +92,16 @@ export default class WebDesktopEnvironment{ * @param {function} onload callback after script loading */ static async load2(appManifest, onload){ - let appElem = document.createElement("div") - appElem.setAttribute("appId", appManifest.appId) - //TODO Render scripts nodes on server - //FIXME Not support more than one js now :) - let script = document.createElement("script") - script.setAttribute("src", appManifest.js[0]) //FIXME path by fs read - script.setAttribute("async", "false") //TODO Possible may creates a problems?? - appElem.appendChild(script) - - document.getElementById("applications").appendChild(appElem) - script.addEventListener('load', (event) => { - let newApp = eval(`new ${appManifest.appId}()`); - //TODO Check if newApp undefined + // import(window.location.origin + appManifest.js[0]).then((app) => { + // console.log(window.location.origin + appManifest.js[0] == 'http://localhost:8080/res/dev-fs/wde/dist/finder.js') + // let kek = 'http://localhost:8080/res/dev-fs/wde/dist/finder.js' + import('http://localhost:8080/res/dev-fs/dist/finder.js').then((app) => { + let newApp = new app.default() + // if newApp //TODO Validate WebDesktopEnvironment.Applications[appManifest.appId] = newApp; onload() }) + return //TODO return result } @@ -116,42 +123,8 @@ export default class WebDesktopEnvironment{ return appManifest } - /** - * @param {string} appId - * @param {number} width - * @param {number} height - * @returns {HTMLElement} - */ - static CreateNewWindow(appId, width, height) { - let newWindow = document.createElement("div") - newWindow.setAttribute('appid', appId) - if (WebDesktopEnvironment.isMobile){ - newWindow.setAttribute("class", "MobileApplicationWindow") - document.body.querySelector('#windows-layer').appendChild(newWindow) - return newWindow - } else { - newWindow.setAttribute("class", "WindowFrame ConvexElement") - newWindow.setAttribute("windowId", WebDesktopEnvironment.makeid(4)) //TODO: + - newWindow.style.width = width.toString() + "px" - newWindow.style.height = height.toString() + "px" - - document.body.querySelector('#windows-layer').appendChild(newWindow) - return newWindow - } - } - /** - * @param {HTMLElement} window - */ - static CloseWindow(window) { - window.remove() - } - - static CloseFocusedWindow() { - if (document.body.querySelector('#windows-layer').childElementCount > 1){ - document.body.querySelector('#windows-layer').lastElementChild.remove() - } - } /** * @param {string} html @@ -203,19 +176,14 @@ export default class WebDesktopEnvironment{ document.body.querySelector('#windows-layer').appendChild(newWindow) } - /** - * @param {num} length - */ - static makeid(length) { - let result = ''; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - const charactersLength = characters.length; - let counter = 0; - while (counter < length) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - counter += 1; - } - return result; - } -} \ No newline at end of file + +} + +/** + * @typedef {Object} runContext + * @property {WebDesktopEnvironment} WDE + * @property {boolean} isMobile + * @property {string} appPath + * @property {string} runPath //TODO +*/ \ No newline at end of file diff --git a/front/src/wde/wde-mobile.js b/front/src/wde/wde-mobile.js index 9802f26..5aaa9e0 100644 --- a/front/src/wde/wde-mobile.js +++ b/front/src/wde/wde-mobile.js @@ -1,10 +1,10 @@ -import MobileDecorat from "../Decorat/mobile-decorat" +// import MobileDecorat from "../Decorat/mobile-decorat" export default class MobileWebDesktopEnvironment{ /** @type {MobileDecorat} */ #decorat constructor(){ document.body.style.setProperty('--zoom', 3) - this.#decorat = new MobileDecorat() + // this.#decorat = new MobileDecorat() } } \ No newline at end of file diff --git a/front/src/wde/widgets/basic-widgets.less b/front/src/wde/widgets/basic-widgets.less new file mode 100644 index 0000000..a38f7cd --- /dev/null +++ b/front/src/wde/widgets/basic-widgets.less @@ -0,0 +1,60 @@ +.ContentBorder { /*TODO Delete, deprecated*/ + width: 100%; + height: 100%; + /* background-color: #DDDDDD; + border: 1px solid #000000; */ + + overflow: hidden; + overflow-x: hidden; +} + +.ContextMenu { + position: absolute; + width: auto; + height: auto; + + background-color: #DDDDDD; + + border: 1px solid #000000; +} + +.ContextMenu .Content{ + position: relative; + width: auto; + height: auto; + + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + /* padding: 4px; + padding-top: 2px; + padding-right: 6px; + gap: 4px; */ +} + +.ContextMenu .Row { + width: 100%; + height: 16px; + +} + +.ContextMenu .SectionBreaker { + + /* background-color: rebeccapurple; */ + +} + +.ContextMenu .Row:hover{ + background-color: #333399; + color: #FFFFFF; +} + +.ContextMenu .Row .Lable{ + margin-left: 20px; + margin-right: 12px; + font-family: "Virtue"; + + white-space: nowrap; +} \ No newline at end of file diff --git a/front/src/wde/widgets/file-view/file-view.js b/front/src/wde/widgets/file-view/file-view.js new file mode 100644 index 0000000..ad2185c --- /dev/null +++ b/front/src/wde/widgets/file-view/file-view.js @@ -0,0 +1,134 @@ + + +export default class WDEFileView{ + path = "" + parentElem = undefined + selected = [] + /** + * @param {HTMLElement} fileViewElem + * @param {Function} doubleClickCallback + * @param {Function} rightClickCallback + * @param {Function} updateFileViewCallback + */ + constructor(fileViewElem, doubleClickCallback, rightClickCallback, fileUploadCallback, updateFileViewCallback){ + //TODO check all params + this.parentElem = fileViewElem + + fileViewElem.addEventListener('click', (event) => { + if (event.target.classList[0] == 'FileTileView') + { + this.DeselectAll() + return + } + if (event.detail === 1){ + this.DeselectAll() + this.Select([event.target]) + } else if (event.detail === 2) { + doubleClickCallback(event) + } + }) + + fileViewElem.addEventListener('contextmenu', (event) => { + event.preventDefault(); + if (event.target.classList.contains("Tile")){ + this.DeselectAll() + this.Select([event.target]) + } + this.Select([event.target]) + rightClickCallback(event) + }) + + if (fileUploadCallback !== undefined) { + let counter = 0 + let draggedElem = undefined + + fileViewElem.addEventListener('dragstart', (event) => { + // console.log(event.target) + // console.log(this.path) + // draggedElem = event.target + event.dataTransfer.setData("fileName", event.target.getAttribute("name")) + event.dataTransfer.setData("filePath", this.path + "/" + event.target.getAttribute("name")) + event.dataTransfer.setData("dropType", "move") + // console.log(updateFileViewCallback) + // event.dataTransfer.setData("updateCallback", updateFileViewCallback) + // event.dataTransfer.setData("fileName", ) + // console.log(draggedElem) + }) + + fileViewElem.addEventListener('dragenter', function(event) { + event.preventDefault(); + counter++ + fileViewElem.classList.add("DragDropBorder") + }) + + fileViewElem.addEventListener('dragend', function(event) { + // console.log(fileViewElem) + event.preventDefault(); + counter-- + if (counter === 0){ + fileViewElem.classList.remove("DragDropBorder") + } + // updateFileViewCallback() + // draggedElem = undefined + }) + + fileViewElem.addEventListener('dragleave', function(event) { + // console.log(fileViewElem) + event.preventDefault(); + counter-- + if (counter === 0){ + fileViewElem.classList.remove("DragDropBorder") + } + // draggedElem = undefined + }) + + fileViewElem.addEventListener('dragover', function(event) { + event.preventDefault(); + }) + + fileViewElem.addEventListener("drop", (event) => { + event.preventDefault(); + fileUploadCallback(event) + fileViewElem.classList.remove("DragDropBorder") + // updateFileViewCallback() + // this.OpenFolder(this.path) + // draggedElem = undefined + }) + } + } + + /** + * @param {[]Element} elements + */ + Select(elements){ + elements.forEach(element => { + this.selected.push(element) + element.classList.add("Selected") + }); + } + + DeselectAll(){ + this.selected.forEach(element => { + element.classList.remove("Selected") + }); + this.selected = [] + } + + /** Get html of folder by path + * @param {string} path + */ + async OpenFolder(path){ + this.path = path + const params = new URLSearchParams({ + path: path + }) + const response = await fetch(`/system/wde/widgets/file-tile-view?` + params) + if (response.status != 200){ + //TODO Error text message + WebDesktopEnvironment.Alert("TODO") + return + } + let html = await response.text() + this.parentElem.innerHTML = html + } +} \ No newline at end of file diff --git a/front/src/wde/widgets/file-view/file-view.less b/front/src/wde/widgets/file-view/file-view.less new file mode 100644 index 0000000..1956f68 --- /dev/null +++ b/front/src/wde/widgets/file-view/file-view.less @@ -0,0 +1,86 @@ +.FileTileView{ + width: 100%; + height: 100%; + + + + /* FIXME Bug, on desktop mode top ~10 pixel are not active, like margin:10px */ +} + +.FileTileView.DragDropBorder{ + box-shadow: inset 0px 0px 0px 4px #9999CC; + /* background-color: blue; */ +} + +.FileTileView .FlexContainer{ + width: 100%; + height: auto; + /* Auto layout */ + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + gap: 50px; + row-gap: 20px; + /* padding: 15px; Shit fix TODO: */ + margin: 15px; + flex-wrap: wrap; + align-content: flex-start; + + /* overflow: scroll; */ + /* overflow-x: hidden; */ + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* Internet Explorer 10+ */ +} + +.FileTileView::-webkit-scrollbar { /* WebKit */ + width: 0; + height: 0; +} + +.FileTileView .Tile{ + width: 50px; + height: 50px; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + gap: 2px; + padding: 0px; + flex-wrap: nowrap; +} + +.FileTileView .Selected{ + /* inherits: ; */ + /* background-color: black; */ +} + +.FileTileView .Icon{ + width: 32px; + height: 32px; + /* background-image: url("./icons/folder.png"); */ + background-size: cover; + + image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */ + image-rendering: -moz-crisp-edges; /* Firefox */ + image-rendering: -o-crisp-edges; /* Opera */ + image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ + image-rendering: pixelated; /* Universal support since 2021 */ + image-rendering: optimize-contrast; /* CSS3 Proposed */ + -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ +} + +.FileTileView .Selected .Icon{ + filter: brightness(0.4); +} + +.FileTileView .Lable{ + white-space: nowrap; +} + +.FileTileView .Selected .Lable{ + white-space: nowrap; + color: white; + background-color: black; +} \ No newline at end of file diff --git a/front/webpack.config.js b/front/webpack.config.cjs similarity index 70% rename from front/webpack.config.js rename to front/webpack.config.cjs index b5cfeea..65b4342 100644 --- a/front/webpack.config.js +++ b/front/webpack.config.cjs @@ -7,21 +7,36 @@ const isProduction = process.env.NODE_ENV == 'production'; const stylesHandler = 'style-loader'; -const MiniCssExtractPlugin = require("mini-css-extract-plugin") +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const { experiments } = require('webpack'); const config = { // entry: [ './src/wde-mobile.js'], entry: { - init: './src/init.js', - mobile: './src/mobile.js', - desktop: './src/desktop.js', - finder: './src/apps/finder/finder.js' + desktop:[ + './src/wde/wde-desktop.js', + ], + desktop_style: [ + "./src/desktop.less", + ], + finder : [ + './src/apps/finder/finder.js', + ], + finder_style:[ + './src/apps/finder/finder.less', + ] }, output: { // path: path.resolve(__dirname, 'dist'), - path: path.resolve('../res/dev-fs/wde/dist'), - filename: '[name].js' + path: path.resolve('../res/dev-fs/dist'), + filename: '[name].js', + library: { + type: "module", + }, }, + experiments: { + outputModule: true, + }, devServer: { open: true, host: 'localhost', @@ -52,7 +67,6 @@ const config = { ], }, }; - module.exports = () => { if (isProduction) { config.mode = 'production'; diff --git a/res/dev-fs/dist/desktop.js b/res/dev-fs/dist/desktop.js new file mode 100644 index 0000000..e590b13 --- /dev/null +++ b/res/dev-fs/dist/desktop.js @@ -0,0 +1,147 @@ +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +import * as __WEBPACK_EXTERNAL_MODULE_http_localhost_8080_res_dev_fs_dist_finder_js_acc14960__ from "http://localhost:8080/res/dev-fs/dist/finder.js"; +/******/ var __webpack_modules__ = ({ + +/***/ "http://localhost:8080/res/dev-fs/dist/finder.js": +/*!******************************************************************!*\ + !*** external "http://localhost:8080/res/dev-fs/dist/finder.js" ***! + \******************************************************************/ +/***/ ((module) => { + +var x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var y = x => () => x +module.exports = __WEBPACK_EXTERNAL_MODULE_http_localhost_8080_res_dev_fs_dist_finder_js_acc14960__; + +/***/ }), + +/***/ "./src/wde/application.js": +/*!********************************!*\ + !*** ./src/wde/application.js ***! + \********************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WDEApplication)\n/* harmony export */ });\n/* harmony import */ var _wde_desktop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wde-desktop.js */ \"./src/wde/wde-desktop.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar _wde = /*#__PURE__*/new WeakMap();\nvar WDEApplication = /*#__PURE__*/function () {\n /** @type {WebDesktopEnvironment} */\n\n /**\n * @constructor\n * @param {WebDesktopEnvironment} wde \n */\n function WDEApplication(wde) {\n _classCallCheck(this, WDEApplication);\n _classPrivateFieldInitSpec(this, _wde, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _wde, wde);\n }\n _createClass(WDEApplication, [{\n key: \"getWde\",\n value: function getWde() {\n return _classPrivateFieldGet(this, _wde);\n }\n }]);\n return WDEApplication;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/application.js?"); + +/***/ }), + +/***/ "./src/wde/decorat/desktop-decorat.js": +/*!********************************************!*\ + !*** ./src/wde/decorat/desktop-decorat.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DesktopDecorat)\n/* harmony export */ });\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nvar _windowsLayer = /*#__PURE__*/new WeakMap();\nvar _makeid = /*#__PURE__*/new WeakSet();\nvar DesktopDecorat = /*#__PURE__*/function () {\n /** @type {Element} */\n\n function DesktopDecorat() {\n var _this = this;\n _classCallCheck(this, DesktopDecorat);\n _classPrivateMethodInitSpec(this, _makeid);\n _classPrivateFieldInitSpec(this, _windowsLayer, {\n writable: true,\n value: void 0\n });\n this.windowLayer = document.body.querySelector('#windows-layer');\n // this.#windowsLayer = document.body.querySelector('#windows-layer')\n _classPrivateFieldSet(this, _windowsLayer, document.body.querySelector('#windows-layer'));\n var startDrag = function startDrag(event) {\n var window = event.target.closest('.WindowFrame');\n _this.bringWindowToFront(window);\n if (event.target.classList.contains(\"DragArea\")) {\n var xPosInit = event.offsetX;\n var yPosInit = event.offsetY;\n var dragWindow = function dragWindow(event) {\n window.style.left = \"\".concat(event.clientX - xPosInit, \"px\");\n window.style.top = \"\".concat(event.clientY - yPosInit, \"px\");\n };\n var stopDrag = function stopDrag() {\n removeEventListener('mousemove', dragWindow);\n removeEventListener('mouseup', stopDrag);\n };\n addEventListener('mousemove', dragWindow);\n addEventListener('mouseup', stopDrag);\n }\n };\n _classPrivateFieldGet(this, _windowsLayer).addEventListener('mousedown', startDrag);\n }\n\n /**\n * @param {HTMLElement} window\n */\n _createClass(DesktopDecorat, [{\n key: \"bringWindowToFront\",\n value: function bringWindowToFront(window) {\n //FIXME\n var previousWindow = _classPrivateFieldGet(this, _windowsLayer).lastChild;\n if (window == null || window == undefined) {\n return;\n }\n if (window != previousWindow) {\n _classPrivateFieldGet(this, _windowsLayer).insertBefore(window, previousWindow.nextSibling);\n previousWindow.classList.remove(\"Focused\");\n window.classList.add(\"Focused\");\n } else {\n window.classList.add(\"Focused\");\n }\n return;\n }\n\n /**\n * @param {string} appId\n * @param {number} width\n * @param {number} height\n * @returns {HTMLElement}\n */\n }, {\n key: \"CreateNewWindow\",\n value: function CreateNewWindow(appId, width, height) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute('appid', appId);\n newWindow.setAttribute(\"class\", \"WindowFrame ConvexElement\");\n newWindow.setAttribute(\"windowId\", _classPrivateMethodGet(this, _makeid, _makeid2).call(this, 4)); //TODO:\n\n newWindow.style.width = width.toString() + \"px\";\n newWindow.style.height = height.toString() + \"px\";\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n return newWindow;\n }\n\n /**\n * @param {HTMLElement} window\n */\n }, {\n key: \"CloseWindow\",\n value: function CloseWindow(window) {\n window.remove();\n }\n }, {\n key: \"CloseFocusedWindow\",\n value: function CloseFocusedWindow() {\n if (document.body.querySelector('#windows-layer').childElementCount > 1) {\n document.body.querySelector('#windows-layer').lastElementChild.remove();\n }\n }\n }], [{\n key: \"ChangeURL\",\n value: function ChangeURL(appWindow) {\n var appId = appWindow.getAttribute('appid');\n window.history.replaceState(null, \"\", \"/\".concat(appId, \"/\"));\n }\n\n /**\n * @param {num} length\n */\n }]);\n return DesktopDecorat;\n}();\nfunction _makeid2(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n var counter = 0;\n while (counter < length) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n}\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/decorat/desktop-decorat.js?"); + +/***/ }), + +/***/ "./src/wde/scrollbar/scrollbar.js": +/*!****************************************!*\ + !*** ./src/wde/scrollbar/scrollbar.js ***! + \****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WdeScrollBar)\n/* harmony export */ });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar WdeScrollBar = /*#__PURE__*/_createClass(\n/**\n* @param {HTMLElement} scrollBarContainer\n* @param {HTMLElement} content\n*/\nfunction WdeScrollBar(scrollBarContainer, content) {\n var _this = this;\n _classCallCheck(this, WdeScrollBar);\n var nonNativeScroll = false;\n // console.log(scrollBarContainer, content)\n // let handler = scrollBarContainer.children[0]\n //TODO On scroll move focus on window?\n var handler = scrollBarContainer.querySelector(\".ScrollBarScrollElement\"); //TODO Refactor classes\n // console.log(handler)\n\n handler.style.height = content.clientHeight / content.scrollHeight * handler.parentElement.clientHeight + 'px';\n var max = handler.parentElement.clientHeight - handler.clientHeight;\n var yPosInit = 0;\n handler.addEventListener('mousedown', function (event) {\n nonNativeScroll = true;\n yPosInit = event.clientY - Number(handler.style.top.replace('px', ''));\n document.addEventListener('mousemove', drag);\n document.addEventListener('mouseup', stop);\n });\n content.addEventListener('scroll', function (event) {\n if (!_this.nonNativeScroll) {\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n handler.style.top = content.scrollTop / coefficient + 'px';\n }\n });\n function drag() {\n // console.log(event.clientY - yPosInit, Number(handler.style.top.replace('px','' )))\n var pos = event.clientY - yPosInit;\n var clampPos = Math.min(Math.max(pos, 0), max);\n handler.style.top = clampPos + \"px\";\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n // console.log(clampPos, coefficient, content.clientHeight, clampPos* coefficient)\n\n content.scrollTop = clampPos * coefficient;\n }\n function stop() {\n // console.log(\"stop\")\n document.removeEventListener('mousemove', drag);\n document.removeEventListener('mouseup', stop);\n nonNativeScroll = false;\n }\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/scrollbar/scrollbar.js?"); + +/***/ }), + +/***/ "./src/wde/wde-desktop.js": +/*!********************************!*\ + !*** ./src/wde/wde-desktop.js ***! + \********************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebDesktopEnvironment)\n/* harmony export */ });\n/* harmony import */ var _decorat_desktop_decorat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decorat/desktop-decorat.js */ \"./src/wde/decorat/desktop-decorat.js\");\n/* harmony import */ var _scrollbar_scrollbar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scrollbar/scrollbar.js */ \"./src/wde/scrollbar/scrollbar.js\");\n/* harmony import */ var _web_fs_web_fs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../web-fs/web-fs.js */ \"./src/web-fs/web-fs.js\");\n/* harmony import */ var _application_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./application.js */ \"./src/wde/application.js\");\n/* harmony import */ var _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./widgets/file-view/file-view.js */ \"./src/wde/widgets/file-view/file-view.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n// import DesktopSunBoard from \"./sunboard/sunboard-desktop.js\";\nvar WebDesktopEnvironment = /*#__PURE__*/function () {\n /** @type {string} */\n\n /** @type {WDEFileView} */\n\n /** @type {WDEScrollBar} */\n\n /**@type {DesktopDecorat} */\n\n /** @type {Object} */\n\n /** Deprecated */\n\n // static decorat\n\n function WebDesktopEnvironment() {\n _classCallCheck(this, WebDesktopEnvironment);\n _defineProperty(this, \"test\", \"\");\n _defineProperty(this, \"FileView\", _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n _defineProperty(this, \"ScrollBar\", _scrollbar_scrollbar_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n _defineProperty(this, \"Decorat\", void 0);\n document.body.style.setProperty('--zoom', 1);\n this.Decorat = new _decorat_desktop_decorat_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n WebDesktopEnvironment.webFs = new _web_fs_web_fs_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this.FileView = _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n this.loadWDE();\n // this.#devLoadSunboard()\n }\n _createClass(WebDesktopEnvironment, [{\n key: \"loadWDE\",\n value: function () {\n var _loadWDE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var autoStart, _iterator, _step, child, appPath, args, argsRaw, _iterator2, _step2, argRaw, arg;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n autoStart = document.body.querySelector(\"wde-autostart\");\n if (!(autoStart == null)) {\n _context.next = 4;\n break;\n }\n WebDesktopEnvironment.Alert(\"Error in loading DE\");\n return _context.abrupt(\"return\");\n case 4:\n _iterator = _createForOfIteratorHelper(autoStart.children);\n _context.prev = 5;\n _iterator.s();\n case 7:\n if ((_step = _iterator.n()).done) {\n _context.next = 41;\n break;\n }\n child = _step.value;\n if (!(child.nodeName != \"APP\")) {\n _context.next = 11;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 11:\n appPath = child.getAttribute(\"app-path\");\n if (!(appPath == null)) {\n _context.next = 14;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 14:\n args = [];\n argsRaw = child.querySelector(\"args\");\n if (!(argsRaw == null)) {\n _context.next = 18;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 18:\n _iterator2 = _createForOfIteratorHelper(argsRaw.children);\n _context.prev = 19;\n _iterator2.s();\n case 21:\n if ((_step2 = _iterator2.n()).done) {\n _context.next = 29;\n break;\n }\n argRaw = _step2.value;\n arg = argRaw.getAttribute(\"string\");\n if (!(arg == null)) {\n _context.next = 26;\n break;\n }\n return _context.abrupt(\"continue\", 27);\n case 26:\n args.push(arg);\n case 27:\n _context.next = 21;\n break;\n case 29:\n _context.next = 34;\n break;\n case 31:\n _context.prev = 31;\n _context.t0 = _context[\"catch\"](19);\n _iterator2.e(_context.t0);\n case 34:\n _context.prev = 34;\n _iterator2.f();\n return _context.finish(34);\n case 37:\n _context.next = 39;\n return this.Open(appPath, args);\n case 39:\n _context.next = 7;\n break;\n case 41:\n _context.next = 46;\n break;\n case 43:\n _context.prev = 43;\n _context.t1 = _context[\"catch\"](5);\n _iterator.e(_context.t1);\n case 46:\n _context.prev = 46;\n _iterator.f();\n return _context.finish(46);\n case 49:\n autoStart.remove();\n case 50:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[5, 43, 46, 49], [19, 31, 34, 37]]);\n }));\n function loadWDE() {\n return _loadWDE.apply(this, arguments);\n }\n return loadWDE;\n }()\n /**\n * @param {string} appPath\n * @param {string[]} args\n * @param {string} runPath\n */\n }, {\n key: \"Open\",\n value: function () {\n var _Open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(appPath, args, runPath) {\n var appManifest, runContext;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return WebDesktopEnvironment.fetchApp(appPath);\n case 2:\n appManifest = _context2.sent;\n if (!(appManifest === undefined)) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n //TODO return err\n /**@type {runContext} */\n runContext = {\n WDE: this,\n isMobile: false,\n bundlePath: appPath,\n runPath: runPath\n };\n if (WebDesktopEnvironment.Applications[appManifest.appId] === undefined) {\n WebDesktopEnvironment.load2(appManifest, function () {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n });\n } else {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n }\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function Open(_x, _x2, _x3) {\n return _Open.apply(this, arguments);\n }\n return Open;\n }()\n /**\n * @param {string} appManifest\n * @param {function} onload callback after script loading\n */\n }], [{\n key: \"load2\",\n value: function () {\n var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(appManifest, onload) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n // import(window.location.origin + appManifest.js[0]).then((app) => {\n // console.log(window.location.origin + appManifest.js[0] == 'http://localhost:8080/res/dev-fs/wde/dist/finder.js')\n // let kek = 'http://localhost:8080/res/dev-fs/wde/dist/finder.js'\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! http://localhost:8080/res/dev-fs/dist/finder.js */ \"http://localhost:8080/res/dev-fs/dist/finder.js\")).then(function (app) {\n var newApp = new app[\"default\"]();\n // if newApp //TODO Validate\n WebDesktopEnvironment.Applications[appManifest.appId] = newApp;\n onload();\n });\n return _context3.abrupt(\"return\");\n case 2:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function load2(_x4, _x5) {\n return _load.apply(this, arguments);\n }\n return load2;\n }()\n /**\n * @param {string} path\n * @returns {Object | undefined} //FIXME\n */\n }, {\n key: \"fetchApp\",\n value: function () {\n var _fetchApp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(path) {\n var params, response, error, appManifest;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n // console.log(\"path: \" + path )\n params = new URLSearchParams({\n path: path,\n mode: \"json\"\n });\n _context4.next = 3;\n return fetch(\"/system/loadApp?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 10;\n break;\n }\n _context4.next = 7;\n return response.json();\n case 7:\n error = _context4.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context4.abrupt(\"return\", undefined);\n case 10:\n //TODO Validate manifest\n appManifest = response.json();\n return _context4.abrupt(\"return\", appManifest);\n case 12:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function fetchApp(_x6) {\n return _fetchApp.apply(this, arguments);\n }\n return fetchApp;\n }()\n /**\n * @param {string} html\n */\n }, {\n key: \"SetBasicWindow\",\n value: function SetBasicWindow(html) {\n this.basicWindow = html;\n }\n\n /**\n * @returns {string}\n */\n }, {\n key: \"GetBasicWindow\",\n value: function GetBasicWindow() {\n return this.basicWindow;\n }\n\n /**\n * @param {string} alertText\n */\n }, {\n key: \"Alert\",\n value: function Alert(alertText) {\n WebDesktopEnvironment.CreateAlertWindow(alertText);\n console.log(alertText);\n }\n\n /**\n * @param {string} alertText\n */\n }, {\n key: \"CreateAlertWindow\",\n value: function CreateAlertWindow(alertText) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute(\"class\", \"WindowFrameless\");\n newWindow.setAttribute(\"windowId\", \"SuperUniqUUID\"); //TODO:\n newWindow.style.cssText = \"position:absolute;width:450px;height:116px; margin-left: -225px; margin-top:-58px;left: 50%;top: 50%;background-color:#FFFFFF;border: 1px solid #000000;box-shadow: 2px 2px 0px #000000;\";\n var alertImage = document.createElement(\"img\");\n alertImage.setAttribute(\"src\", \"/res/sys/wde/icons/ohno.png\");\n alertImage.style.cssText = \"position:absolute; width:64px;height:64px;top:15px;left:25px\";\n newWindow.appendChild(alertImage);\n var errorText = document.createElement(\"div\");\n errorText.style.cssText = \"position:absolute; width: 300px; left:128px; top:30px;font-family: 'Virtue';\";\n errorText.innerHTML = alertText;\n newWindow.appendChild(errorText);\n var closeButton = document.createElement(\"button\");\n closeButton.style.cssText = \"position:absolute; left: 382px; bottom: 10px; background-color:#FFFFFF; width: 55px; height:18px; font-family: 'Virtue'; border-radius:4px;border: 1px solid #000000;\";\n closeButton.innerHTML = \"Close\";\n closeButton.addEventListener('click', function () {\n newWindow.remove();\n });\n newWindow.appendChild(closeButton);\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n }\n }]);\n return WebDesktopEnvironment;\n}();\n/**\n * @typedef {Object} runContext\n * @property {WebDesktopEnvironment} WDE \n * @property {boolean} isMobile\n * @property {string} appPath \n * @property {string} runPath //TODO\n*/\n_defineProperty(WebDesktopEnvironment, \"Applications\", {});\n_defineProperty(WebDesktopEnvironment, \"isMobile\", false);\n_defineProperty(WebDesktopEnvironment, \"webFs\", void 0);\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/wde-desktop.js?"); + +/***/ }), + +/***/ "./src/wde/widgets/file-view/file-view.js": +/*!************************************************!*\ + !*** ./src/wde/widgets/file-view/file-view.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WDEFileView)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nvar WDEFileView = /*#__PURE__*/function () {\n /**\n * @param {HTMLElement} fileViewElem\n * @param {Function} doubleClickCallback\n * @param {Function} rightClickCallback\n * @param {Function} updateFileViewCallback\n */\n function WDEFileView(fileViewElem, doubleClickCallback, rightClickCallback, fileUploadCallback, updateFileViewCallback) {\n var _this = this;\n _classCallCheck(this, WDEFileView);\n _defineProperty(this, \"path\", \"\");\n _defineProperty(this, \"parentElem\", undefined);\n _defineProperty(this, \"selected\", []);\n //TODO check all params\n this.parentElem = fileViewElem;\n fileViewElem.addEventListener('click', function (event) {\n if (event.target.classList[0] == 'FileTileView') {\n _this.DeselectAll();\n return;\n }\n if (event.detail === 1) {\n _this.DeselectAll();\n _this.Select([event.target]);\n } else if (event.detail === 2) {\n doubleClickCallback(event);\n }\n });\n fileViewElem.addEventListener('contextmenu', function (event) {\n event.preventDefault();\n if (event.target.classList.contains(\"Tile\")) {\n _this.DeselectAll();\n _this.Select([event.target]);\n }\n _this.Select([event.target]);\n rightClickCallback(event);\n });\n if (fileUploadCallback !== undefined) {\n var counter = 0;\n var draggedElem = undefined;\n fileViewElem.addEventListener('dragstart', function (event) {\n // console.log(event.target)\n // console.log(this.path)\n // draggedElem = event.target\n event.dataTransfer.setData(\"fileName\", event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"filePath\", _this.path + \"/\" + event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"dropType\", \"move\");\n // console.log(updateFileViewCallback)\n // event.dataTransfer.setData(\"updateCallback\", updateFileViewCallback)\n // event.dataTransfer.setData(\"fileName\", )\n // console.log(draggedElem)\n });\n\n fileViewElem.addEventListener('dragenter', function (event) {\n event.preventDefault();\n counter++;\n fileViewElem.classList.add(\"DragDropBorder\");\n });\n fileViewElem.addEventListener('dragend', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // updateFileViewCallback()\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragleave', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragover', function (event) {\n event.preventDefault();\n });\n fileViewElem.addEventListener(\"drop\", function (event) {\n event.preventDefault();\n fileUploadCallback(event);\n fileViewElem.classList.remove(\"DragDropBorder\");\n // updateFileViewCallback()\n // this.OpenFolder(this.path)\n // draggedElem = undefined\n });\n }\n }\n\n /** \n * @param {[]Element} elements\n */\n _createClass(WDEFileView, [{\n key: \"Select\",\n value: function Select(elements) {\n var _this2 = this;\n elements.forEach(function (element) {\n _this2.selected.push(element);\n element.classList.add(\"Selected\");\n });\n }\n }, {\n key: \"DeselectAll\",\n value: function DeselectAll() {\n this.selected.forEach(function (element) {\n element.classList.remove(\"Selected\");\n });\n this.selected = [];\n }\n\n /** Get html of folder by path\n * @param {string} path\n */\n }, {\n key: \"OpenFolder\",\n value: function () {\n var _OpenFolder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response, html;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.path = path;\n params = new URLSearchParams({\n path: path\n });\n _context.next = 4;\n return fetch(\"/system/wde/widgets/file-tile-view?\" + params);\n case 4:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 8;\n break;\n }\n //TODO Error text message\n WebDesktopEnvironment.Alert(\"TODO\");\n return _context.abrupt(\"return\");\n case 8:\n _context.next = 10;\n return response.text();\n case 10:\n html = _context.sent;\n this.parentElem.innerHTML = html;\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function OpenFolder(_x) {\n return _OpenFolder.apply(this, arguments);\n }\n return OpenFolder;\n }()\n }]);\n return WDEFileView;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/widgets/file-view/file-view.js?"); + +/***/ }), + +/***/ "./src/web-fs/web-fs.js": +/*!******************************!*\ + !*** ./src/web-fs/web-fs.js ***! + \******************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebFS)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nvar WebFS = /*#__PURE__*/function () {\n function WebFS() {\n _classCallCheck(this, WebFS);\n }\n _createClass(WebFS, null, [{\n key: \"CreateDirectory\",\n value:\n /**\n * @param {string} path\n * @returns {boolean}\n */\n function () {\n var _CreateDirectory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(path == undefined)) {\n _context.next = 3;\n break;\n }\n WebDesktopEnvironment.Alert(\"Path is undefined\");\n return _context.abrupt(\"return\", false);\n case 3:\n params = new URLSearchParams({\n path: \"\".concat(path, \"/New Directory\")\n });\n _context.next = 6;\n return fetch(\"/system/fs/createDir?\" + params);\n case 6:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 10;\n break;\n }\n WebDesktopEnvironment.Alert(\"DIRCTORY CREATION ERROR\"); //TODO\n return _context.abrupt(\"return\", false);\n case 10:\n return _context.abrupt(\"return\", true);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n function CreateDirectory(_x) {\n return _CreateDirectory.apply(this, arguments);\n }\n return CreateDirectory;\n }()\n /**\n * @param {string} path\n * @returns {boolean}\n */\n }, {\n key: \"DeleteFile\",\n value: function () {\n var _DeleteFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n params = new URLSearchParams({\n path: path\n });\n _context2.next = 3;\n return fetch(\"/system/fs/delete?\" + params);\n case 3:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"DELETE ERROR\"); //TODO\n return _context2.abrupt(\"return\", false);\n case 7:\n return _context2.abrupt(\"return\", true);\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n function DeleteFile(_x2) {\n return _DeleteFile.apply(this, arguments);\n }\n return DeleteFile;\n }()\n /**\n * @param {string} path\n * @returns {boolean}\n */\n }, {\n key: \"MoveFile\",\n value: function () {\n var _MoveFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sourcePath, targetPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n targetPath: targetPath\n });\n _context3.next = 3;\n return fetch(\"/system/fs/move?\" + params);\n case 3:\n response = _context3.sent;\n if (!(response.status != 200)) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function MoveFile(_x3, _x4) {\n return _MoveFile.apply(this, arguments);\n }\n return MoveFile;\n }()\n /**\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"ReadObjectLink\",\n value: function () {\n var _ReadObjectLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(linkPath) {\n var params, response, path;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context4.next = 3;\n return fetch(\"/system/fs/readObjectLink?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context4.abrupt(\"return\", \"\");\n case 7:\n _context4.next = 9;\n return response.text();\n case 9:\n path = _context4.sent;\n return _context4.abrupt(\"return\", path);\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function ReadObjectLink(_x5) {\n return _ReadObjectLink.apply(this, arguments);\n }\n return ReadObjectLink;\n }()\n /**\n * @param {string} sourcePath\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"CreatePathLink\",\n value: function () {\n var _CreatePathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sourcePath, linkPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n linkPath: linkPath\n });\n _context5.next = 3;\n return fetch(\"/system/fs/createPathLink?\" + params);\n case 3:\n response = _context5.sent;\n return _context5.abrupt(\"return\", response.status == 200);\n case 5:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n function CreatePathLink(_x6, _x7) {\n return _CreatePathLink.apply(this, arguments);\n }\n return CreatePathLink;\n }()\n /**\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"ReadPathLink\",\n value: function () {\n var _ReadPathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(linkPath) {\n var params, response, file;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context6.next = 3;\n return fetch(\"/system/fs/readPathLink?\" + params);\n case 3:\n response = _context6.sent;\n if (!(response.status != 200)) {\n _context6.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context6.abrupt(\"return\", \"\");\n case 7:\n _context6.next = 9;\n return response.json();\n case 9:\n file = _context6.sent;\n return _context6.abrupt(\"return\", file);\n case 11:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n function ReadPathLink(_x8) {\n return _ReadPathLink.apply(this, arguments);\n }\n return ReadPathLink;\n }()\n /**\n * @param {File} file\n * @param {string} parentPath\n * @returns {boolean}\n */\n }, {\n key: \"UploadFile\",\n value: function () {\n var _UploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file, parentPath) {\n var formData, params, response, error;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n console.log('here');\n formData = new FormData();\n formData.append(\"file\", file); //FIXME Conn reset\n params = new URLSearchParams({\n parentPath: parentPath\n });\n _context7.next = 6;\n return fetch(\"/system/fs/upload?\" + params, {\n method: \"POST\",\n //TODO Change to PUT?\n body: formData\n });\n case 6:\n response = _context7.sent;\n console.log(response.status);\n if (!(response.status != 201)) {\n _context7.next = 14;\n break;\n }\n _context7.next = 11;\n return response.json();\n case 11:\n error = _context7.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context7.abrupt(\"return\", false);\n case 14:\n return _context7.abrupt(\"return\", true);\n case 15:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7);\n }));\n function UploadFile(_x9, _x10) {\n return _UploadFile.apply(this, arguments);\n }\n return UploadFile;\n }()\n }]);\n return WebFS;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/web-fs/web-fs.js?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__("./src/wde/wde-desktop.js"); +/******/ var __webpack_exports__default = __webpack_exports__["default"]; +/******/ export { __webpack_exports__default as default }; +/******/ diff --git a/res/dev-fs/dist/desktop_style.css b/res/dev-fs/dist/desktop_style.css new file mode 100644 index 0000000..21bdc3b --- /dev/null +++ b/res/dev-fs/dist/desktop_style.css @@ -0,0 +1,384 @@ +/*!***********************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/desktop.less ***! + \***********************************************************************************************************/ +.WdePrimitives.AdjectiveElement { + border: 1px solid #555555; +} +.FileTileView { + width: 100%; + height: 100%; + /* FIXME Bug, on desktop mode top ~10 pixel are not active, like margin:10px */ +} +.FileTileView.DragDropBorder { + box-shadow: inset 0px 0px 0px 4px #9999CC; + /* background-color: blue; */ +} +.FileTileView .FlexContainer { + width: 100%; + height: auto; + /* Auto layout */ + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + gap: 50px; + row-gap: 20px; + /* padding: 15px; Shit fix TODO: */ + margin: 15px; + flex-wrap: wrap; + align-content: flex-start; + /* overflow: scroll; */ + /* overflow-x: hidden; */ + scrollbar-width: none; + /* Firefox */ + -ms-overflow-style: none; + /* Internet Explorer 10+ */ +} +.FileTileView::-webkit-scrollbar { + /* WebKit */ + width: 0; + height: 0; +} +.FileTileView .Tile { + width: 50px; + height: 50px; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + gap: 2px; + padding: 0px; + flex-wrap: nowrap; +} +.FileTileView .Selected { + /* inherits: ; */ + /* background-color: black; */ +} +.FileTileView .Icon { + width: 32px; + height: 32px; + /* background-image: url("./icons/folder.png"); */ + background-size: cover; + image-rendering: optimizeSpeed; + /* STOP SMOOTHING, GIVE ME SPEED */ + image-rendering: -moz-crisp-edges; + /* Firefox */ + image-rendering: -o-crisp-edges; + /* Opera */ + image-rendering: -webkit-optimize-contrast; + /* Chrome (and eventually Safari) */ + image-rendering: pixelated; + /* Universal support since 2021 */ + image-rendering: optimize-contrast; + /* CSS3 Proposed */ + -ms-interpolation-mode: nearest-neighbor; + /* IE8+ */ +} +.FileTileView .Selected .Icon { + filter: brightness(0.4); +} +.FileTileView .Lable { + white-space: nowrap; +} +.FileTileView .Selected .Lable { + white-space: nowrap; + color: white; + background-color: black; +} +.WindowFrame { + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + padding: 4px; + padding-top: 2px; + padding-right: 6px; + gap: 4px; + position: absolute; + background: #DDDDDD; + border: 1px solid #555555; + /* Inside auto layout */ + flex: none; + order: 1; + align-self: stretch; + flex-grow: 1; +} +/* TODO Add shadows to windows */ +.WindowFrame.Focused { + border: 1px solid #000000; + background-color: #CCCCCC; +} +.WindowFrameShadow { + box-shadow: 2px 2px 0px #555555; +} +/* FIXME Not work on context menu */ +.WindowFrameShadow.Focused { + box-shadow: 2px 2px 0px #000000; +} +.ConvexElement.Focused { + box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25), inset -1px -1px 0px rgba(0, 0, 0, 0.27), inset 1px 1px 0px #FFFFFF; +} +.AdjectiveElement { + border: 1px solid #555555; +} +.Focused .AdjectiveElement { + border: 1px solid #000000; + box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25), 1px 1px 0px #FFFFFF; + /* inset -1px -1px 0px rgba(0, 0, 0, 0.27), */ + /* inset 1px 1px 0px #FFFFFF;*/ +} +.AdjectiveHorizontalLine { + border-top: 1px solid rgba(0, 0, 0, 0.25); + border-bottom: 1px solid #FFFFFF; + width: 100%; + height: 0px; +} +.AdjectiveHorizontalLine:last-child { + height: 0%; + visibility: hidden; +} +.WindowFrame .TitleBar { + width: 100%; + height: 13px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 5px; + padding: 0px; + /* Inside auto layout */ + flex: none; + order: 0; + align-self: stretch; + flex-grow: 0; +} +.WindowFrame .TitleBar .Lable { + position: relative; + top: 1px; + /* font-size: 13px; */ + color: #777777; + pointer-events: none; + white-space: nowrap; + font-family: "Virtue"; + letter-spacing: 0.35px; +} +.WindowFrame.Focused .TitleBar .Lable { + color: #000000; +} +.WindowFrame .TitleBar .Button { + width: 11px; + height: 11px; + padding: 0%; + position: relative; + top: 1px; + visibility: hidden; + background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%); + border: 1px solid #222222; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), inset 1px 1px 0px rgba(255, 255, 255, 0.5), inset -1px -1px 0px rgba(0, 0, 0, 0.27); + /* Inside auto layout */ + flex: none; + order: 0; + flex-grow: 0; +} +.WindowFrame.Focused .TitleBar .Button { + visibility: visible; +} +.WindowFrame .TitleBar .Button:active { + background-color: rgba(0, 0, 0, 0.4); + /* Green */ + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25); +} +.Focused .VisualDragArea { + pointer-events: none; + width: 100%; + height: 11px; + background: linear-gradient(transparent 0%, white 0%, white 50%, transparent 50%); + background-size: 2px 2px; + filter: drop-shadow(1px 1px 0px #777777); +} +.MobileContentBorder { + width: 100%; + height: 100%; + background-color: #DDDDDD; + /* border: 1px solid #000000; */ + /* box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25), + 1px 1px 0px #FFFFFF, + inset -1px -1px 0px rgba(0, 0, 0, 0.27), + inset 1px 1px 0px #FFFFFF; */ + overflow: hidden; + overflow-x: hidden; + /* Auto layout */ + display: flex; + flex-direction: row; + justify-content: center; + align-items: flex-start; + padding: 0px; +} +.MobileApplicationWindow { + width: 100%; + height: 100%; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + position: absolute; + top: 0px; + left: 0px; +} +.MobileWindowFrameBottomBar { + width: 100%; + height: 20px; + /* + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + gap: 5px; + padding: 0px; */ + /* Inside auto layout */ + flex: none; + order: 0; + align-self: stretch; + flex-grow: 0; +} +.MobileWindowFrameBottomBarButton { + min-width: 11px; + width: auto; + height: 15px; + padding: 0px 4px 0px 4px; + position: absolute; + right: 4px; + background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%); + border: 1px solid #222222; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), inset 1px 1px 0px rgba(255, 255, 255, 0.5), inset -1px -1px 0px rgba(0, 0, 0, 0.27); + /* Inside auto layout */ + flex: none; + order: 0; + flex-grow: 0; +} +.MobileWindowFrameBottomBar .MobileLable { + position: absolute; + /* top:1px; */ + /* font-size: 13px; */ + left: 50%; + pointer-events: none; + white-space: nowrap; + font-family: "Virtue"; + letter-spacing: 0.35px; +} +.ContentBorder { + /*TODO Delete, deprecated*/ + width: 100%; + height: 100%; + /* background-color: #DDDDDD; + border: 1px solid #000000; */ + overflow: hidden; + overflow-x: hidden; +} +.ContextMenu { + position: absolute; + width: auto; + height: auto; + background-color: #DDDDDD; + border: 1px solid #000000; +} +.ContextMenu .Content { + position: relative; + width: auto; + height: auto; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + /* padding: 4px; + padding-top: 2px; + padding-right: 6px; + gap: 4px; */ +} +.ContextMenu .Row { + width: 100%; + height: 16px; +} +.ContextMenu .SectionBreaker { + /* background-color: rebeccapurple; */ +} +.ContextMenu .Row:hover { + background-color: #333399; + color: #FFFFFF; +} +.ContextMenu .Row .Lable { + margin-left: 20px; + margin-right: 12px; + font-family: "Virtue"; + white-space: nowrap; +} +/* @font-face{ + font-family: "Virtue"; + src:url("/res/dev-fs/fonts/virtue.ttf") +} */ +/* @media screen and (max-device-width: 2048px) and (max-device-height: 2048px) { + html { + zoom: 3 + } + } */ +.NoClick { + pointer-events: none; +} +.Click { + pointer-events: all; +} +* { + font-family: Verdana, Geneva, sans-serif; + font-size: 11px; + font-style: normal; + font-weight: initial; +} +*::-webkit-scrollbar { + /* WebKit */ + width: 0; + height: 0; +} +body { + zoom: var(--zoom); + position: absolute; + width: 100%; + height: 100%; + margin: 0px; + /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ + -webkit-touch-callout: none; + /* iOS Safari */ + -webkit-user-select: none; + /* Safari */ + -khtml-user-select: none; + /* Konqueror HTML */ + -moz-user-select: none; + /* Old versions of Firefox */ + -ms-user-select: none; + /* Internet Explorer/Edge */ + user-select: none; + /* Non-prefixed version, currently + supported by Chrome, Edge, Opera and Firefox */ + touch-action: manipulation; +} +#applications { + position: static; + width: 0px; + height: 0px; + visibility: hidden; +} +#windows-layer { + width: 0px; + height: 0px; + /* position: fixed; */ + position: static; +} +#desktop-layer { + position: fixed; + /* margin: 0px; */ + width: 100%; + height: 100%; + background-color: #9999CC; +} + diff --git a/res/dev-fs/dist/desktop_style.js b/res/dev-fs/dist/desktop_style.js new file mode 100644 index 0000000..379a34e --- /dev/null +++ b/res/dev-fs/dist/desktop_style.js @@ -0,0 +1,45 @@ +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +/******/ var __webpack_modules__ = ({ + +/***/ "./src/desktop.less": +/*!**************************!*\ + !*** ./src/desktop.less ***! + \**************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://my-webpack-project/./src/desktop.less?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module can't be inlined because the eval devtool is used. +/******/ var __webpack_exports__ = {}; +/******/ __webpack_modules__["./src/desktop.less"](0, __webpack_exports__, __webpack_require__); +/******/ diff --git a/res/dev-fs/wde/dist/finder.css b/res/dev-fs/dist/finder.css similarity index 100% rename from res/dev-fs/wde/dist/finder.css rename to res/dev-fs/dist/finder.css diff --git a/res/dev-fs/dist/finder.js b/res/dev-fs/dist/finder.js new file mode 100644 index 0000000..5012f1f --- /dev/null +++ b/res/dev-fs/dist/finder.js @@ -0,0 +1,167 @@ +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +import * as __WEBPACK_EXTERNAL_MODULE_http_localhost_8080_res_dev_fs_dist_finder_js_acc14960__ from "http://localhost:8080/res/dev-fs/dist/finder.js"; +/******/ var __webpack_modules__ = ({ + +/***/ "http://localhost:8080/res/dev-fs/dist/finder.js": +/*!******************************************************************!*\ + !*** external "http://localhost:8080/res/dev-fs/dist/finder.js" ***! + \******************************************************************/ +/***/ ((module) => { + +var x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var y = x => () => x +module.exports = __WEBPACK_EXTERNAL_MODULE_http_localhost_8080_res_dev_fs_dist_finder_js_acc14960__; + +/***/ }), + +/***/ "./src/apps/finder/finder-window.js": +/*!******************************************!*\ + !*** ./src/apps/finder/finder-window.js ***! + \******************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ FinderWindow)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nvar _appId = /*#__PURE__*/new WeakMap();\nvar _wde = /*#__PURE__*/new WeakMap();\nvar _finder = /*#__PURE__*/new WeakMap();\n// import WebDesktopEnvironment from \"../../wde/wde-desktop\"\n// import Finder from \"./finder\"\n// import WebDesktopEnvironment from \"../../wde/wde-desktop\"\nvar FinderWindow = /*#__PURE__*/function () {\n function FinderWindow() {\n _classCallCheck(this, FinderWindow);\n _classPrivateFieldInitSpec(this, _appId, {\n writable: true,\n value: \"Finder\"\n });\n _defineProperty(this, \"curPath\", \"\");\n _defineProperty(this, \"fileView\", undefined);\n _defineProperty(this, \"windowElem\", undefined);\n _classPrivateFieldInitSpec(this, _wde, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldInitSpec(this, _finder, {\n writable: true,\n value: void 0\n });\n }\n _createClass(FinderWindow, [{\n key: \"Init\",\n value:\n /**\n * @param {Finder} finder\n * @param {*} args \n * @param {import(\"../../wde/wde-desktop\").runContext} runContext \n * @returns \n */\n function () {\n var _Init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(finder, args, runContext) {\n var _this = this;\n var desktopNode, _params, _response, _html, params, response, error, html, newWindow, scrollBar;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _classPrivateFieldSet(this, _finder, finder);\n _classPrivateFieldSet(this, _wde, runContext.WDE);\n if (!(args[1] == \"--desktop\")) {\n _context.next = 22;\n break;\n }\n desktopNode = document.body.querySelector(\"#\".concat(args[2]));\n if (!(desktopNode == null)) {\n _context.next = 7;\n break;\n }\n _classPrivateFieldGet(this, _wde).Alert(\"Desktop node not found\");\n return _context.abrupt(\"return\");\n case 7:\n _params = new URLSearchParams({\n path: args[0]\n });\n _context.next = 10;\n return fetch(\"/app/\".concat(_classPrivateFieldGet(this, _appId), \"/renderDesktop?\") + _params, {\n method: \"POST\",\n body: JSON.stringify(runContext)\n });\n case 10:\n _response = _context.sent;\n if (!(_response.status != 200)) {\n _context.next = 15;\n break;\n }\n console.log(_response.status);\n _classPrivateFieldGet(this, _wde).Alert(\"Error in render desktop\"); //TODO\n return _context.abrupt(\"return\");\n case 15:\n _context.next = 17;\n return _response.text();\n case 17:\n _html = _context.sent;\n desktopNode.innerHTML = _html;\n this.fileView = new runContext.WDE.FileView(desktopNode.querySelector(\".FileTileView\"), function (event) {\n _this.Click(event);\n }, function (event) {\n _this.RightClick(event);\n }, function (event, draggedElem) {\n _this.DropEvent(event, draggedElem);\n }, function () {\n _this.ReRenderDir();\n });\n this.RenderDir(args[0]);\n return _context.abrupt(\"return\");\n case 22:\n params = new URLSearchParams({\n isMobile: false\n }); //FIXME\n _context.next = 25;\n return fetch(\"/app/\".concat(_classPrivateFieldGet(this, _appId), \"/render?\") + params, {\n method: \"POST\",\n body: JSON.stringify(runContext)\n });\n case 25:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 32;\n break;\n }\n _context.next = 29;\n return response.json();\n case 29:\n error = _context.sent;\n _classPrivateFieldGet(this, _wde).Alert(error.message);\n return _context.abrupt(\"return\");\n case 32:\n _context.next = 34;\n return response.text();\n case 34:\n html = _context.sent;\n newWindow = _classPrivateFieldGet(this, _wde).Decorat.CreateNewWindow(_classPrivateFieldGet(this, _appId), 500, 350);\n newWindow.innerHTML = html;\n\n // console.log(this.#wde)\n\n this.fileView = new runContext.WDE.FileView(newWindow.querySelector(\".FileTileView\"), function (event) {\n _this.Click(event);\n }, function (event) {\n _this.RightClick(event);\n }, function (event, draggedElem) {\n _this.DropEvent(event, draggedElem);\n }, function () {\n _this.ReRenderDir();\n });\n newWindow.querySelector(\"#closeWindowButton\").addEventListener('click', function () {\n _classPrivateFieldGet(_this, _wde).Decorat.CloseWindow(newWindow);\n });\n newWindow.querySelector(\"#RootButton\").addEventListener('click', function () {\n _this.RenderDir('/');\n });\n newWindow.querySelector(\"#HomeButton\").addEventListener('click', function () {\n _this.RenderDir('/home/user');\n });\n scrollBar = new (_classPrivateFieldGet(this, _wde).ScrollBar)(newWindow.querySelector(\".ScrollbarPlace\"), newWindow.querySelector(\".FileTileView\"));\n this.windowElem = newWindow;\n this.RenderDir(args[0]);\n case 44:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function Init(_x, _x2, _x3) {\n return _Init.apply(this, arguments);\n }\n return Init;\n }()\n /**\n * @param {string} path\n */\n }, {\n key: \"RenderDir\",\n value: function RenderDir(path) {\n this.curPath = path;\n this.fileView.OpenFolder(path);\n }\n }, {\n key: \"ReRenderDir\",\n value: function ReRenderDir() {\n this.RenderDir(this.curPath);\n }\n\n /**\n * @param {DragEvent} event\n * @param {HTMLElement} draggedElem\n */\n }, {\n key: \"DropEvent\",\n value: function () {\n var _DropEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {\n var sourcePath, targetPath, res, files, i, file, _res, params, response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(event.dataTransfer.getData(\"dropType\") == \"move\")) {\n _context2.next = 9;\n break;\n }\n sourcePath = event.dataTransfer.getData(\"filePath\");\n targetPath = this.curPath + \"/\" + event.dataTransfer.getData(\"fileName\");\n _context2.next = 5;\n return WebFS.MoveFile(sourcePath, targetPath);\n case 5:\n res = _context2.sent;\n if (res) {\n this.ReRenderDir();\n } else {\n _classPrivateFieldGet(this, _wde).Alert(\"UWAGA TODO MOVE FILE ERROR\"); //TODO\n }\n _context2.next = 27;\n break;\n case 9:\n console.log(event, this.curPath);\n files = event.dataTransfer.files;\n i = 0;\n case 12:\n if (!(i < files.length)) {\n _context2.next = 22;\n break;\n }\n file = files[i];\n console.log(\"file:\" + file.name);\n _context2.next = 17;\n return WebFS.UploadFile(file, this.curPath);\n case 17:\n _res = _context2.sent;\n if (_res) {\n this.ReRenderDir();\n }\n case 19:\n i++;\n _context2.next = 12;\n break;\n case 22:\n params = new URLSearchParams({\n parentPath: this.curPath\n });\n _context2.next = 25;\n return fetch('/fs/upload/?' + params, {\n method: \"POST\",\n //TODO Change to PUT?\n body: formData\n });\n case 25:\n response = _context2.sent;\n if (response.status != 200) {\n _classPrivateFieldGet(this, _wde).Alert(\"ERROR IN UPLOADING FILE\"); //TODO\n } else {\n this.ReRenderDir();\n }\n case 27:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function DropEvent(_x4) {\n return _DropEvent.apply(this, arguments);\n }\n return DropEvent;\n }()\n /**\n * @param {MouseEvent} event\n */\n }, {\n key: \"Click\",\n value: function Click(event) {\n this.OpenFile(this.curPath, event.target.getAttribute(\"name\"), event.target.getAttribute(\"filetype\"));\n }\n\n /**\n * @param {string} filePath\n */\n }, {\n key: \"OpenFile\",\n value: function () {\n var _OpenFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parentPath, fileName, fileType) {\n var fileExtension, res;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n // console.log(parentPath, fileName, fileType)\n // const splittedPath = filePath.split(\"/\")\n // const fileName = splittedPath[splittedPath.length - 1]\n fileExtension = fileName.split(\".\")[fileName.split(\".\").length - 1]; //FIXME\n _context3.t0 = true;\n _context3.next = _context3.t0 === (fileType == \"objectlink\") ? 4 : _context3.t0 === (fileType == \"pathlink\") ? 6 : _context3.t0 === (fileExtension == \"app\") ? 12 : _context3.t0 === (fileExtension == \"blog\") ? 14 : _context3.t0 === (fileType == \"directory\") ? 16 : _context3.t0 === (fileExtension == \"blog\") ? 18 : _context3.t0 === (fileExtension == \"jpeg\" | fileExtension == \"png\") ? 20 : 22;\n break;\n case 4:\n _classPrivateFieldGet(this, _wde).Alert(\"Links not supported yet\");\n return _context3.abrupt(\"break\", 24);\n case 6:\n _context3.next = 8;\n return WebFS.ReadPathLink(\"\".concat(parentPath, \"/\").concat(fileName));\n case 8:\n res = _context3.sent;\n console.log(res);\n this.OpenFile(res.parentPath, res.name, res.filetype);\n return _context3.abrupt(\"break\", 24);\n case 12:\n _classPrivateFieldGet(this, _wde).Open(\"\".concat(parentPath, \"/\").concat(fileName), []);\n return _context3.abrupt(\"break\", 24);\n case 14:\n _classPrivateFieldGet(this, _wde).Open(\"/Applications/BlogViewer.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 16:\n _classPrivateFieldGet(this, _wde).Open(\"/Applications/Finder.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 18:\n _classPrivateFieldGet(this, _wde).Open(\"/Applications/BlogViewer.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 20:\n _classPrivateFieldGet(this, _wde).Open(\"img-viewer\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 22:\n _classPrivateFieldGet(this, _wde).Alert(\"Unsupported file type\");\n return _context3.abrupt(\"break\", 24);\n case 24:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n function OpenFile(_x5, _x6, _x7) {\n return _OpenFile.apply(this, arguments);\n }\n return OpenFile;\n }()\n /**\n * @param {MouseEvent} event\n */\n }, {\n key: \"RightClick\",\n value: function RightClick(event) {\n this.CreateContextMenu(event.target, [event.clientY, event.clientX]);\n }\n\n /**\n * @param {HTMLElement} target\n * @param {string[]} pos\n */\n }, {\n key: \"CreateContextMenu\",\n value: function () {\n var _CreateContextMenu = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(target, pos) {\n var _this2 = this;\n var context, fileName, fileType, path, params, response, html, overlay, menu;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n context = \"\";\n fileName = target.getAttribute(\"name\"); //TODO check for null\n fileType = target.getAttribute(\"fileType\");\n if (target.classList.contains(\"FileTileView\")) {\n context = \"FileTileView\";\n } else {\n context = fileType;\n }\n path = \"\";\n if (fileName === null) {\n path = this.curPath;\n } else {\n path = \"\".concat(this.curPath, \"/\").concat(fileName);\n }\n params = new URLSearchParams({\n context: context,\n path: path\n });\n _context5.next = 9;\n return fetch(\"/app/\".concat(_classPrivateFieldGet(this, _appId), \"/contextMenu?\") + params);\n case 9:\n response = _context5.sent;\n if (!(response.status != 200)) {\n _context5.next = 13;\n break;\n }\n _classPrivateFieldGet(this, _wde).Alert(\"ERROR in Context menu TODO\"); //TODO\n return _context5.abrupt(\"return\");\n case 13:\n _context5.next = 15;\n return response.text();\n case 15:\n html = _context5.sent;\n overlay = document.createElement(\"div\"); //TODO Move to WDE.CreateOverlay()\n overlay.setAttribute('id', 'finder-context-menu-overlay');\n overlay.style.position = 'absolute';\n overlay.style.width = \"100%\";\n overlay.style.height = \"100%\";\n menu = document.createElement(\"div\");\n menu.setAttribute('class', 'ContextMenu WindowFrameShadow');\n menu.style.position = 'absolute';\n menu.style.top = pos[0] + \"px\";\n menu.style.left = pos[1] + \"px\";\n menu.innerHTML = html;\n // menu.children[0].firstElementChild.remove()\n menu.children[0].lastElementChild.remove(); //FIXME Can't ommit rendering of horLine in end of menu on backend\n\n overlay.appendChild(menu);\n document.body.appendChild(overlay);\n overlay.addEventListener('click', /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(event) {\n var res;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!event.target.classList.contains(\"Row\")) {\n _context4.next = 27;\n break;\n }\n //TODO add uuid id to rows to more accurate checks??\n res = false;\n _context4.t0 = event.target.children[0].getAttribute(\"action\");\n _context4.next = _context4.t0 === \"createPathLink\" ? 5 : _context4.t0 === \"createDir\" ? 10 : _context4.t0 === \"deleteFile\" ? 16 : _context4.t0 === \"getInfo\" ? 22 : _context4.t0 === \"openAsDir\" ? 24 : 26;\n break;\n case 5:\n _context4.next = 7;\n return WebFS.CreatePathLink(\"\".concat(_this2.curPath, \"/\").concat(fileName), \"\".concat(_this2.curPath, \"/Link to \").concat(fileName));\n case 7:\n res = _context4.sent;\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 10:\n _context4.next = 12;\n return WebFS.CreateDirectory(\"\".concat(_this2.curPath));\n case 12:\n res = _context4.sent;\n console.log(res);\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 16:\n _context4.next = 18;\n return WebFS.DeleteFile(\"\".concat(_this2.curPath, \"/\").concat(fileName));\n case 18:\n res = _context4.sent;\n console.log(res);\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 22:\n Finder.RenderProperites(path);\n return _context4.abrupt(\"break\", 27);\n case 24:\n _classPrivateFieldGet(_this2, _wde).Open(\"/Applications/\".concat(_classPrivateFieldGet(_this2, _appId), \".app\"), [\"\".concat(_this2.curPath, \"/\").concat(fileName)]);\n return _context4.abrupt(\"break\", 27);\n case 26:\n return _context4.abrupt(\"break\", 27);\n case 27:\n overlay.remove();\n case 28:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n return function (_x10) {\n return _ref.apply(this, arguments);\n };\n }());\n overlay.addEventListener('contextmenu', function (event) {\n event.preventDefault();\n overlay.remove();\n });\n case 32:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n function CreateContextMenu(_x8, _x9) {\n return _CreateContextMenu.apply(this, arguments);\n }\n return CreateContextMenu;\n }()\n }]);\n return FinderWindow;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder-window.js?"); + +/***/ }), + +/***/ "./src/apps/finder/finder.js": +/*!***********************************!*\ + !*** ./src/apps/finder/finder.js ***! + \***********************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Finder)\n/* harmony export */ });\n/* harmony import */ var _wde_application_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../wde/application.js */ \"./src/wde/application.js\");\n/* harmony import */ var _wde_wde_desktop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../wde/wde-desktop.js */ \"./src/wde/wde-desktop.js\");\n/* harmony import */ var _finder_window_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./finder-window.js */ \"./src/apps/finder/finder-window.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n// require(\"./finder.less\")\n\n\n\n\nvar Finder = /*#__PURE__*/function (_WDEApplication) {\n _inherits(Finder, _WDEApplication);\n var _super = _createSuper(Finder);\n /**\n * @constructor\n * @param {WebDesktopEnvironment} wde \n */\n function Finder(wde) {\n _classCallCheck(this, Finder);\n /** @type {WDEApplication} */\n return _super.call(this, wde);\n }\n\n /**\n * @param {string[]} args\n * @param {import(\"../../wde/wde-desktop.js\").runContext}\n */\n _createClass(Finder, [{\n key: \"NewWindow\",\n value: function () {\n var _NewWindow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(args, runContext) {\n var newFinder;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n newFinder = new _finder_window_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n _context.next = 3;\n return newFinder.Init(this, args, runContext);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function NewWindow(_x, _x2) {\n return _NewWindow.apply(this, arguments);\n }\n return NewWindow;\n }()\n /**\n * @param {string} path\n * @returns {boolean}\n */\n }, {\n key: \"RenderProperites\",\n value: function () {\n var _RenderProperites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {\n var params, response, html, newWindow;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(path == null || path == \"\")) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n params = new URLSearchParams({\n path: path\n });\n _context2.next = 5;\n return fetch(\"/app/\".concat(Finder.AppId, \"/renderProps?\") + params);\n case 5:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 8;\n break;\n }\n return _context2.abrupt(\"return\", false);\n case 8:\n _context2.next = 10;\n return response.text();\n case 10:\n html = _context2.sent;\n newWindow = _get(_getPrototypeOf(Finder.prototype), \"getWde\", this).call(this).Decorat.CreateNewWindow(Finder.AppId, 350, 500);\n newWindow.innerHTML = html;\n newWindow.querySelector(\"#closeWindowButton\").addEventListener('click', function (params) {\n // WebDesktopEnvironment.CloseWindow(newWindow)\n });\n case 14:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function RenderProperites(_x3) {\n return _RenderProperites.apply(this, arguments);\n }\n return RenderProperites;\n }()\n }]);\n return Finder;\n}(_wde_application_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n_defineProperty(Finder, \"AppId\", \"Finder\");\n\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder.js?"); + +/***/ }), + +/***/ "./src/wde/application.js": +/*!********************************!*\ + !*** ./src/wde/application.js ***! + \********************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WDEApplication)\n/* harmony export */ });\n/* harmony import */ var _wde_desktop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wde-desktop.js */ \"./src/wde/wde-desktop.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar _wde = /*#__PURE__*/new WeakMap();\nvar WDEApplication = /*#__PURE__*/function () {\n /** @type {WebDesktopEnvironment} */\n\n /**\n * @constructor\n * @param {WebDesktopEnvironment} wde \n */\n function WDEApplication(wde) {\n _classCallCheck(this, WDEApplication);\n _classPrivateFieldInitSpec(this, _wde, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _wde, wde);\n }\n _createClass(WDEApplication, [{\n key: \"getWde\",\n value: function getWde() {\n return _classPrivateFieldGet(this, _wde);\n }\n }]);\n return WDEApplication;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/application.js?"); + +/***/ }), + +/***/ "./src/wde/decorat/desktop-decorat.js": +/*!********************************************!*\ + !*** ./src/wde/decorat/desktop-decorat.js ***! + \********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DesktopDecorat)\n/* harmony export */ });\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nvar _windowsLayer = /*#__PURE__*/new WeakMap();\nvar _makeid = /*#__PURE__*/new WeakSet();\nvar DesktopDecorat = /*#__PURE__*/function () {\n /** @type {Element} */\n\n function DesktopDecorat() {\n var _this = this;\n _classCallCheck(this, DesktopDecorat);\n _classPrivateMethodInitSpec(this, _makeid);\n _classPrivateFieldInitSpec(this, _windowsLayer, {\n writable: true,\n value: void 0\n });\n this.windowLayer = document.body.querySelector('#windows-layer');\n // this.#windowsLayer = document.body.querySelector('#windows-layer')\n _classPrivateFieldSet(this, _windowsLayer, document.body.querySelector('#windows-layer'));\n var startDrag = function startDrag(event) {\n var window = event.target.closest('.WindowFrame');\n _this.bringWindowToFront(window);\n if (event.target.classList.contains(\"DragArea\")) {\n var xPosInit = event.offsetX;\n var yPosInit = event.offsetY;\n var dragWindow = function dragWindow(event) {\n window.style.left = \"\".concat(event.clientX - xPosInit, \"px\");\n window.style.top = \"\".concat(event.clientY - yPosInit, \"px\");\n };\n var stopDrag = function stopDrag() {\n removeEventListener('mousemove', dragWindow);\n removeEventListener('mouseup', stopDrag);\n };\n addEventListener('mousemove', dragWindow);\n addEventListener('mouseup', stopDrag);\n }\n };\n _classPrivateFieldGet(this, _windowsLayer).addEventListener('mousedown', startDrag);\n }\n\n /**\n * @param {HTMLElement} window\n */\n _createClass(DesktopDecorat, [{\n key: \"bringWindowToFront\",\n value: function bringWindowToFront(window) {\n //FIXME\n var previousWindow = _classPrivateFieldGet(this, _windowsLayer).lastChild;\n if (window == null || window == undefined) {\n return;\n }\n if (window != previousWindow) {\n _classPrivateFieldGet(this, _windowsLayer).insertBefore(window, previousWindow.nextSibling);\n previousWindow.classList.remove(\"Focused\");\n window.classList.add(\"Focused\");\n } else {\n window.classList.add(\"Focused\");\n }\n return;\n }\n\n /**\n * @param {string} appId\n * @param {number} width\n * @param {number} height\n * @returns {HTMLElement}\n */\n }, {\n key: \"CreateNewWindow\",\n value: function CreateNewWindow(appId, width, height) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute('appid', appId);\n newWindow.setAttribute(\"class\", \"WindowFrame ConvexElement\");\n newWindow.setAttribute(\"windowId\", _classPrivateMethodGet(this, _makeid, _makeid2).call(this, 4)); //TODO:\n\n newWindow.style.width = width.toString() + \"px\";\n newWindow.style.height = height.toString() + \"px\";\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n return newWindow;\n }\n\n /**\n * @param {HTMLElement} window\n */\n }, {\n key: \"CloseWindow\",\n value: function CloseWindow(window) {\n window.remove();\n }\n }, {\n key: \"CloseFocusedWindow\",\n value: function CloseFocusedWindow() {\n if (document.body.querySelector('#windows-layer').childElementCount > 1) {\n document.body.querySelector('#windows-layer').lastElementChild.remove();\n }\n }\n }], [{\n key: \"ChangeURL\",\n value: function ChangeURL(appWindow) {\n var appId = appWindow.getAttribute('appid');\n window.history.replaceState(null, \"\", \"/\".concat(appId, \"/\"));\n }\n\n /**\n * @param {num} length\n */\n }]);\n return DesktopDecorat;\n}();\nfunction _makeid2(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n var counter = 0;\n while (counter < length) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n}\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/decorat/desktop-decorat.js?"); + +/***/ }), + +/***/ "./src/wde/scrollbar/scrollbar.js": +/*!****************************************!*\ + !*** ./src/wde/scrollbar/scrollbar.js ***! + \****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WdeScrollBar)\n/* harmony export */ });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar WdeScrollBar = /*#__PURE__*/_createClass(\n/**\n* @param {HTMLElement} scrollBarContainer\n* @param {HTMLElement} content\n*/\nfunction WdeScrollBar(scrollBarContainer, content) {\n var _this = this;\n _classCallCheck(this, WdeScrollBar);\n var nonNativeScroll = false;\n // console.log(scrollBarContainer, content)\n // let handler = scrollBarContainer.children[0]\n //TODO On scroll move focus on window?\n var handler = scrollBarContainer.querySelector(\".ScrollBarScrollElement\"); //TODO Refactor classes\n // console.log(handler)\n\n handler.style.height = content.clientHeight / content.scrollHeight * handler.parentElement.clientHeight + 'px';\n var max = handler.parentElement.clientHeight - handler.clientHeight;\n var yPosInit = 0;\n handler.addEventListener('mousedown', function (event) {\n nonNativeScroll = true;\n yPosInit = event.clientY - Number(handler.style.top.replace('px', ''));\n document.addEventListener('mousemove', drag);\n document.addEventListener('mouseup', stop);\n });\n content.addEventListener('scroll', function (event) {\n if (!_this.nonNativeScroll) {\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n handler.style.top = content.scrollTop / coefficient + 'px';\n }\n });\n function drag() {\n // console.log(event.clientY - yPosInit, Number(handler.style.top.replace('px','' )))\n var pos = event.clientY - yPosInit;\n var clampPos = Math.min(Math.max(pos, 0), max);\n handler.style.top = clampPos + \"px\";\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n // console.log(clampPos, coefficient, content.clientHeight, clampPos* coefficient)\n\n content.scrollTop = clampPos * coefficient;\n }\n function stop() {\n // console.log(\"stop\")\n document.removeEventListener('mousemove', drag);\n document.removeEventListener('mouseup', stop);\n nonNativeScroll = false;\n }\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/scrollbar/scrollbar.js?"); + +/***/ }), + +/***/ "./src/wde/wde-desktop.js": +/*!********************************!*\ + !*** ./src/wde/wde-desktop.js ***! + \********************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebDesktopEnvironment)\n/* harmony export */ });\n/* harmony import */ var _decorat_desktop_decorat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decorat/desktop-decorat.js */ \"./src/wde/decorat/desktop-decorat.js\");\n/* harmony import */ var _scrollbar_scrollbar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scrollbar/scrollbar.js */ \"./src/wde/scrollbar/scrollbar.js\");\n/* harmony import */ var _web_fs_web_fs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../web-fs/web-fs.js */ \"./src/web-fs/web-fs.js\");\n/* harmony import */ var _application_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./application.js */ \"./src/wde/application.js\");\n/* harmony import */ var _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./widgets/file-view/file-view.js */ \"./src/wde/widgets/file-view/file-view.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n// import DesktopSunBoard from \"./sunboard/sunboard-desktop.js\";\nvar WebDesktopEnvironment = /*#__PURE__*/function () {\n /** @type {string} */\n\n /** @type {WDEFileView} */\n\n /** @type {WDEScrollBar} */\n\n /**@type {DesktopDecorat} */\n\n /** @type {Object} */\n\n /** Deprecated */\n\n // static decorat\n\n function WebDesktopEnvironment() {\n _classCallCheck(this, WebDesktopEnvironment);\n _defineProperty(this, \"test\", \"\");\n _defineProperty(this, \"FileView\", _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n _defineProperty(this, \"ScrollBar\", _scrollbar_scrollbar_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n _defineProperty(this, \"Decorat\", void 0);\n document.body.style.setProperty('--zoom', 1);\n this.Decorat = new _decorat_desktop_decorat_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n WebDesktopEnvironment.webFs = new _web_fs_web_fs_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this.FileView = _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n this.loadWDE();\n // this.#devLoadSunboard()\n }\n _createClass(WebDesktopEnvironment, [{\n key: \"loadWDE\",\n value: function () {\n var _loadWDE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var autoStart, _iterator, _step, child, appPath, args, argsRaw, _iterator2, _step2, argRaw, arg;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n autoStart = document.body.querySelector(\"wde-autostart\");\n if (!(autoStart == null)) {\n _context.next = 4;\n break;\n }\n WebDesktopEnvironment.Alert(\"Error in loading DE\");\n return _context.abrupt(\"return\");\n case 4:\n _iterator = _createForOfIteratorHelper(autoStart.children);\n _context.prev = 5;\n _iterator.s();\n case 7:\n if ((_step = _iterator.n()).done) {\n _context.next = 41;\n break;\n }\n child = _step.value;\n if (!(child.nodeName != \"APP\")) {\n _context.next = 11;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 11:\n appPath = child.getAttribute(\"app-path\");\n if (!(appPath == null)) {\n _context.next = 14;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 14:\n args = [];\n argsRaw = child.querySelector(\"args\");\n if (!(argsRaw == null)) {\n _context.next = 18;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 18:\n _iterator2 = _createForOfIteratorHelper(argsRaw.children);\n _context.prev = 19;\n _iterator2.s();\n case 21:\n if ((_step2 = _iterator2.n()).done) {\n _context.next = 29;\n break;\n }\n argRaw = _step2.value;\n arg = argRaw.getAttribute(\"string\");\n if (!(arg == null)) {\n _context.next = 26;\n break;\n }\n return _context.abrupt(\"continue\", 27);\n case 26:\n args.push(arg);\n case 27:\n _context.next = 21;\n break;\n case 29:\n _context.next = 34;\n break;\n case 31:\n _context.prev = 31;\n _context.t0 = _context[\"catch\"](19);\n _iterator2.e(_context.t0);\n case 34:\n _context.prev = 34;\n _iterator2.f();\n return _context.finish(34);\n case 37:\n _context.next = 39;\n return this.Open(appPath, args);\n case 39:\n _context.next = 7;\n break;\n case 41:\n _context.next = 46;\n break;\n case 43:\n _context.prev = 43;\n _context.t1 = _context[\"catch\"](5);\n _iterator.e(_context.t1);\n case 46:\n _context.prev = 46;\n _iterator.f();\n return _context.finish(46);\n case 49:\n autoStart.remove();\n case 50:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[5, 43, 46, 49], [19, 31, 34, 37]]);\n }));\n function loadWDE() {\n return _loadWDE.apply(this, arguments);\n }\n return loadWDE;\n }()\n /**\n * @param {string} appPath\n * @param {string[]} args\n * @param {string} runPath\n */\n }, {\n key: \"Open\",\n value: function () {\n var _Open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(appPath, args, runPath) {\n var appManifest, runContext;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return WebDesktopEnvironment.fetchApp(appPath);\n case 2:\n appManifest = _context2.sent;\n if (!(appManifest === undefined)) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n //TODO return err\n /**@type {runContext} */\n runContext = {\n WDE: this,\n isMobile: false,\n bundlePath: appPath,\n runPath: runPath\n };\n if (WebDesktopEnvironment.Applications[appManifest.appId] === undefined) {\n WebDesktopEnvironment.load2(appManifest, function () {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n });\n } else {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n }\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function Open(_x, _x2, _x3) {\n return _Open.apply(this, arguments);\n }\n return Open;\n }()\n /**\n * @param {string} appManifest\n * @param {function} onload callback after script loading\n */\n }], [{\n key: \"load2\",\n value: function () {\n var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(appManifest, onload) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n // import(window.location.origin + appManifest.js[0]).then((app) => {\n // console.log(window.location.origin + appManifest.js[0] == 'http://localhost:8080/res/dev-fs/wde/dist/finder.js')\n // let kek = 'http://localhost:8080/res/dev-fs/wde/dist/finder.js'\n Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! http://localhost:8080/res/dev-fs/dist/finder.js */ \"http://localhost:8080/res/dev-fs/dist/finder.js\")).then(function (app) {\n var newApp = new app[\"default\"]();\n // if newApp //TODO Validate\n WebDesktopEnvironment.Applications[appManifest.appId] = newApp;\n onload();\n });\n return _context3.abrupt(\"return\");\n case 2:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function load2(_x4, _x5) {\n return _load.apply(this, arguments);\n }\n return load2;\n }()\n /**\n * @param {string} path\n * @returns {Object | undefined} //FIXME\n */\n }, {\n key: \"fetchApp\",\n value: function () {\n var _fetchApp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(path) {\n var params, response, error, appManifest;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n // console.log(\"path: \" + path )\n params = new URLSearchParams({\n path: path,\n mode: \"json\"\n });\n _context4.next = 3;\n return fetch(\"/system/loadApp?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 10;\n break;\n }\n _context4.next = 7;\n return response.json();\n case 7:\n error = _context4.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context4.abrupt(\"return\", undefined);\n case 10:\n //TODO Validate manifest\n appManifest = response.json();\n return _context4.abrupt(\"return\", appManifest);\n case 12:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function fetchApp(_x6) {\n return _fetchApp.apply(this, arguments);\n }\n return fetchApp;\n }()\n /**\n * @param {string} html\n */\n }, {\n key: \"SetBasicWindow\",\n value: function SetBasicWindow(html) {\n this.basicWindow = html;\n }\n\n /**\n * @returns {string}\n */\n }, {\n key: \"GetBasicWindow\",\n value: function GetBasicWindow() {\n return this.basicWindow;\n }\n\n /**\n * @param {string} alertText\n */\n }, {\n key: \"Alert\",\n value: function Alert(alertText) {\n WebDesktopEnvironment.CreateAlertWindow(alertText);\n console.log(alertText);\n }\n\n /**\n * @param {string} alertText\n */\n }, {\n key: \"CreateAlertWindow\",\n value: function CreateAlertWindow(alertText) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute(\"class\", \"WindowFrameless\");\n newWindow.setAttribute(\"windowId\", \"SuperUniqUUID\"); //TODO:\n newWindow.style.cssText = \"position:absolute;width:450px;height:116px; margin-left: -225px; margin-top:-58px;left: 50%;top: 50%;background-color:#FFFFFF;border: 1px solid #000000;box-shadow: 2px 2px 0px #000000;\";\n var alertImage = document.createElement(\"img\");\n alertImage.setAttribute(\"src\", \"/res/sys/wde/icons/ohno.png\");\n alertImage.style.cssText = \"position:absolute; width:64px;height:64px;top:15px;left:25px\";\n newWindow.appendChild(alertImage);\n var errorText = document.createElement(\"div\");\n errorText.style.cssText = \"position:absolute; width: 300px; left:128px; top:30px;font-family: 'Virtue';\";\n errorText.innerHTML = alertText;\n newWindow.appendChild(errorText);\n var closeButton = document.createElement(\"button\");\n closeButton.style.cssText = \"position:absolute; left: 382px; bottom: 10px; background-color:#FFFFFF; width: 55px; height:18px; font-family: 'Virtue'; border-radius:4px;border: 1px solid #000000;\";\n closeButton.innerHTML = \"Close\";\n closeButton.addEventListener('click', function () {\n newWindow.remove();\n });\n newWindow.appendChild(closeButton);\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n }\n }]);\n return WebDesktopEnvironment;\n}();\n/**\n * @typedef {Object} runContext\n * @property {WebDesktopEnvironment} WDE \n * @property {boolean} isMobile\n * @property {string} appPath \n * @property {string} runPath //TODO\n*/\n_defineProperty(WebDesktopEnvironment, \"Applications\", {});\n_defineProperty(WebDesktopEnvironment, \"isMobile\", false);\n_defineProperty(WebDesktopEnvironment, \"webFs\", void 0);\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/wde-desktop.js?"); + +/***/ }), + +/***/ "./src/wde/widgets/file-view/file-view.js": +/*!************************************************!*\ + !*** ./src/wde/widgets/file-view/file-view.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WDEFileView)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nvar WDEFileView = /*#__PURE__*/function () {\n /**\n * @param {HTMLElement} fileViewElem\n * @param {Function} doubleClickCallback\n * @param {Function} rightClickCallback\n * @param {Function} updateFileViewCallback\n */\n function WDEFileView(fileViewElem, doubleClickCallback, rightClickCallback, fileUploadCallback, updateFileViewCallback) {\n var _this = this;\n _classCallCheck(this, WDEFileView);\n _defineProperty(this, \"path\", \"\");\n _defineProperty(this, \"parentElem\", undefined);\n _defineProperty(this, \"selected\", []);\n //TODO check all params\n this.parentElem = fileViewElem;\n fileViewElem.addEventListener('click', function (event) {\n if (event.target.classList[0] == 'FileTileView') {\n _this.DeselectAll();\n return;\n }\n if (event.detail === 1) {\n _this.DeselectAll();\n _this.Select([event.target]);\n } else if (event.detail === 2) {\n doubleClickCallback(event);\n }\n });\n fileViewElem.addEventListener('contextmenu', function (event) {\n event.preventDefault();\n if (event.target.classList.contains(\"Tile\")) {\n _this.DeselectAll();\n _this.Select([event.target]);\n }\n _this.Select([event.target]);\n rightClickCallback(event);\n });\n if (fileUploadCallback !== undefined) {\n var counter = 0;\n var draggedElem = undefined;\n fileViewElem.addEventListener('dragstart', function (event) {\n // console.log(event.target)\n // console.log(this.path)\n // draggedElem = event.target\n event.dataTransfer.setData(\"fileName\", event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"filePath\", _this.path + \"/\" + event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"dropType\", \"move\");\n // console.log(updateFileViewCallback)\n // event.dataTransfer.setData(\"updateCallback\", updateFileViewCallback)\n // event.dataTransfer.setData(\"fileName\", )\n // console.log(draggedElem)\n });\n\n fileViewElem.addEventListener('dragenter', function (event) {\n event.preventDefault();\n counter++;\n fileViewElem.classList.add(\"DragDropBorder\");\n });\n fileViewElem.addEventListener('dragend', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // updateFileViewCallback()\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragleave', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragover', function (event) {\n event.preventDefault();\n });\n fileViewElem.addEventListener(\"drop\", function (event) {\n event.preventDefault();\n fileUploadCallback(event);\n fileViewElem.classList.remove(\"DragDropBorder\");\n // updateFileViewCallback()\n // this.OpenFolder(this.path)\n // draggedElem = undefined\n });\n }\n }\n\n /** \n * @param {[]Element} elements\n */\n _createClass(WDEFileView, [{\n key: \"Select\",\n value: function Select(elements) {\n var _this2 = this;\n elements.forEach(function (element) {\n _this2.selected.push(element);\n element.classList.add(\"Selected\");\n });\n }\n }, {\n key: \"DeselectAll\",\n value: function DeselectAll() {\n this.selected.forEach(function (element) {\n element.classList.remove(\"Selected\");\n });\n this.selected = [];\n }\n\n /** Get html of folder by path\n * @param {string} path\n */\n }, {\n key: \"OpenFolder\",\n value: function () {\n var _OpenFolder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response, html;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.path = path;\n params = new URLSearchParams({\n path: path\n });\n _context.next = 4;\n return fetch(\"/system/wde/widgets/file-tile-view?\" + params);\n case 4:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 8;\n break;\n }\n //TODO Error text message\n WebDesktopEnvironment.Alert(\"TODO\");\n return _context.abrupt(\"return\");\n case 8:\n _context.next = 10;\n return response.text();\n case 10:\n html = _context.sent;\n this.parentElem.innerHTML = html;\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function OpenFolder(_x) {\n return _OpenFolder.apply(this, arguments);\n }\n return OpenFolder;\n }()\n }]);\n return WDEFileView;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/widgets/file-view/file-view.js?"); + +/***/ }), + +/***/ "./src/web-fs/web-fs.js": +/*!******************************!*\ + !*** ./src/web-fs/web-fs.js ***! + \******************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebFS)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nvar WebFS = /*#__PURE__*/function () {\n function WebFS() {\n _classCallCheck(this, WebFS);\n }\n _createClass(WebFS, null, [{\n key: \"CreateDirectory\",\n value:\n /**\n * @param {string} path\n * @returns {boolean}\n */\n function () {\n var _CreateDirectory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(path == undefined)) {\n _context.next = 3;\n break;\n }\n WebDesktopEnvironment.Alert(\"Path is undefined\");\n return _context.abrupt(\"return\", false);\n case 3:\n params = new URLSearchParams({\n path: \"\".concat(path, \"/New Directory\")\n });\n _context.next = 6;\n return fetch(\"/system/fs/createDir?\" + params);\n case 6:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 10;\n break;\n }\n WebDesktopEnvironment.Alert(\"DIRCTORY CREATION ERROR\"); //TODO\n return _context.abrupt(\"return\", false);\n case 10:\n return _context.abrupt(\"return\", true);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n function CreateDirectory(_x) {\n return _CreateDirectory.apply(this, arguments);\n }\n return CreateDirectory;\n }()\n /**\n * @param {string} path\n * @returns {boolean}\n */\n }, {\n key: \"DeleteFile\",\n value: function () {\n var _DeleteFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n params = new URLSearchParams({\n path: path\n });\n _context2.next = 3;\n return fetch(\"/system/fs/delete?\" + params);\n case 3:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"DELETE ERROR\"); //TODO\n return _context2.abrupt(\"return\", false);\n case 7:\n return _context2.abrupt(\"return\", true);\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n function DeleteFile(_x2) {\n return _DeleteFile.apply(this, arguments);\n }\n return DeleteFile;\n }()\n /**\n * @param {string} path\n * @returns {boolean}\n */\n }, {\n key: \"MoveFile\",\n value: function () {\n var _MoveFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sourcePath, targetPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n targetPath: targetPath\n });\n _context3.next = 3;\n return fetch(\"/system/fs/move?\" + params);\n case 3:\n response = _context3.sent;\n if (!(response.status != 200)) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function MoveFile(_x3, _x4) {\n return _MoveFile.apply(this, arguments);\n }\n return MoveFile;\n }()\n /**\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"ReadObjectLink\",\n value: function () {\n var _ReadObjectLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(linkPath) {\n var params, response, path;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context4.next = 3;\n return fetch(\"/system/fs/readObjectLink?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context4.abrupt(\"return\", \"\");\n case 7:\n _context4.next = 9;\n return response.text();\n case 9:\n path = _context4.sent;\n return _context4.abrupt(\"return\", path);\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function ReadObjectLink(_x5) {\n return _ReadObjectLink.apply(this, arguments);\n }\n return ReadObjectLink;\n }()\n /**\n * @param {string} sourcePath\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"CreatePathLink\",\n value: function () {\n var _CreatePathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sourcePath, linkPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n linkPath: linkPath\n });\n _context5.next = 3;\n return fetch(\"/system/fs/createPathLink?\" + params);\n case 3:\n response = _context5.sent;\n return _context5.abrupt(\"return\", response.status == 200);\n case 5:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n function CreatePathLink(_x6, _x7) {\n return _CreatePathLink.apply(this, arguments);\n }\n return CreatePathLink;\n }()\n /**\n * @param {string} linkPath\n * @returns {string}\n */\n }, {\n key: \"ReadPathLink\",\n value: function () {\n var _ReadPathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(linkPath) {\n var params, response, file;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context6.next = 3;\n return fetch(\"/system/fs/readPathLink?\" + params);\n case 3:\n response = _context6.sent;\n if (!(response.status != 200)) {\n _context6.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context6.abrupt(\"return\", \"\");\n case 7:\n _context6.next = 9;\n return response.json();\n case 9:\n file = _context6.sent;\n return _context6.abrupt(\"return\", file);\n case 11:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n function ReadPathLink(_x8) {\n return _ReadPathLink.apply(this, arguments);\n }\n return ReadPathLink;\n }()\n /**\n * @param {File} file\n * @param {string} parentPath\n * @returns {boolean}\n */\n }, {\n key: \"UploadFile\",\n value: function () {\n var _UploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file, parentPath) {\n var formData, params, response, error;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n console.log('here');\n formData = new FormData();\n formData.append(\"file\", file); //FIXME Conn reset\n params = new URLSearchParams({\n parentPath: parentPath\n });\n _context7.next = 6;\n return fetch(\"/system/fs/upload?\" + params, {\n method: \"POST\",\n //TODO Change to PUT?\n body: formData\n });\n case 6:\n response = _context7.sent;\n console.log(response.status);\n if (!(response.status != 201)) {\n _context7.next = 14;\n break;\n }\n _context7.next = 11;\n return response.json();\n case 11:\n error = _context7.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context7.abrupt(\"return\", false);\n case 14:\n return _context7.abrupt(\"return\", true);\n case 15:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7);\n }));\n function UploadFile(_x9, _x10) {\n return _UploadFile.apply(this, arguments);\n }\n return UploadFile;\n }()\n }]);\n return WebFS;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/web-fs/web-fs.js?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module can't be inlined because the eval devtool is used. +/******/ var __webpack_exports__ = __webpack_require__("./src/apps/finder/finder.js"); +/******/ var __webpack_exports__default = __webpack_exports__["default"]; +/******/ export { __webpack_exports__default as default }; +/******/ diff --git a/res/dev-fs/dist/finder_style.css b/res/dev-fs/dist/finder_style.css new file mode 100644 index 0000000..f34475b --- /dev/null +++ b/res/dev-fs/dist/finder_style.css @@ -0,0 +1,35 @@ +/*!**********************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/apps/finder/finder.less ***! + \**********************************************************************************************************************/ +.FinderContent { + width: 100%; + height: 100%; + /* Auto layout */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 0px; +} +.FinderContent .ToolBar { + width: 100%; + height: 20px; + border-bottom: 1px solid #555555; + background-color: #EEEEEE; +} +.Focused .FinderContent .ToolBar { + border-bottom: 1px solid #000000; + background-color: #DDDDDD; +} +.FinderContent .FinderFileView { + width: 100%; + height: 100%; + background-color: #FFFFFF; + /* Auto layout */ + display: flex; + flex-direction: row; + justify-content: center; + align-items: flex-start; + padding: 0px; +} + diff --git a/res/dev-fs/dist/finder_style.js b/res/dev-fs/dist/finder_style.js new file mode 100644 index 0000000..a206f38 --- /dev/null +++ b/res/dev-fs/dist/finder_style.js @@ -0,0 +1,45 @@ +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +/******/ var __webpack_modules__ = ({ + +/***/ "./src/apps/finder/finder.less": +/*!*************************************!*\ + !*** ./src/apps/finder/finder.less ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder.less?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module can't be inlined because the eval devtool is used. +/******/ var __webpack_exports__ = {}; +/******/ __webpack_modules__["./src/apps/finder/finder.less"](0, __webpack_exports__, __webpack_require__); +/******/ diff --git a/res/dev-fs/wde/dist/desktop.js b/res/dev-fs/wde/dist/desktop.js deleted file mode 100644 index 1d7367d..0000000 --- a/res/dev-fs/wde/dist/desktop.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/decorat/desktop-decorat.js": -/*!****************************************!*\ - !*** ./src/decorat/desktop-decorat.js ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DesktopDecorat)\n/* harmony export */ });\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nvar _windowsLayer = /*#__PURE__*/new WeakMap();\nvar DesktopDecorat = /*#__PURE__*/function () {\n /** @type {Element} */\n\n function DesktopDecorat() {\n _classCallCheck(this, DesktopDecorat);\n _classPrivateFieldInitSpec(this, _windowsLayer, {\n writable: true,\n value: void 0\n });\n this.windowLayer = document.body.querySelector('#windows-layer');\n // this.#windowsLayer = document.body.querySelector('#windows-layer')\n _classPrivateFieldSet(this, _windowsLayer, document.body.querySelector('#windows-layer'));\n var startDrag = function startDrag(event) {\n var window = event.target.closest('.WindowFrame');\n DesktopDecorat.bringWindowToFront(window);\n if (event.target.classList.contains(\"DragArea\")) {\n var xPosInit = event.offsetX;\n var yPosInit = event.offsetY;\n var dragWindow = function dragWindow(event) {\n window.style.left = \"\".concat(event.clientX - xPosInit, \"px\");\n window.style.top = \"\".concat(event.clientY - yPosInit, \"px\");\n };\n var stopDrag = function stopDrag() {\n removeEventListener('mousemove', dragWindow);\n removeEventListener('mouseup', stopDrag);\n };\n addEventListener('mousemove', dragWindow);\n addEventListener('mouseup', stopDrag);\n }\n };\n _classPrivateFieldGet(this, _windowsLayer).addEventListener('mousedown', startDrag);\n }\n\n /**\r\n * @param {HTMLElement} window\r\n */\n _createClass(DesktopDecorat, null, [{\n key: \"bringWindowToFront\",\n value: function bringWindowToFront(window) {\n //FIXME\n var previousWindow = _classPrivateFieldGet(this, _windowsLayer).lastChild;\n if (window == null || window == undefined) {\n return;\n }\n if (window != previousWindow) {\n _classPrivateFieldGet(this, _windowsLayer).insertBefore(window, previousWindow.nextSibling);\n previousWindow.classList.remove(\"Focused\");\n window.classList.add(\"Focused\");\n } else {\n window.classList.add(\"Focused\");\n }\n return;\n }\n }, {\n key: \"ChangeURL\",\n value: function ChangeURL(appWindow) {\n var appId = appWindow.getAttribute('appid');\n window.history.replaceState(null, \"\", \"/\".concat(appId, \"/\"));\n }\n }]);\n return DesktopDecorat;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/decorat/desktop-decorat.js?"); - -/***/ }), - -/***/ "./src/desktop.js": -/*!************************!*\ - !*** ./src/desktop.js ***! - \************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wde_wde_desktop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wde/wde-desktop */ \"./src/wde/wde-desktop.js\");\n\ndocument.addEventListener('DOMContentLoaded', function () {\n var wde = new _wde_wde_desktop__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n}, false);\n\n//# sourceURL=webpack://my-webpack-project/./src/desktop.js?"); - -/***/ }), - -/***/ "./src/wde/scrollbar/scrollbar.js": -/*!****************************************!*\ - !*** ./src/wde/scrollbar/scrollbar.js ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WdeScrollBar)\n/* harmony export */ });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar WdeScrollBar = /*#__PURE__*/_createClass(\n/**\r\n* @param {HTMLElement} scrollBarContainer\r\n* @param {HTMLElement} content\r\n*/\nfunction WdeScrollBar(scrollBarContainer, content) {\n var _this = this;\n _classCallCheck(this, WdeScrollBar);\n var nonNativeScroll = false;\n // console.log(scrollBarContainer, content)\n // let handler = scrollBarContainer.children[0]\n //TODO On scroll move focus on window?\n var handler = scrollBarContainer.querySelector(\".ScrollBarScrollElement\"); //TODO Refactor classes\n // console.log(handler)\n\n handler.style.height = content.clientHeight / content.scrollHeight * handler.parentElement.clientHeight + 'px';\n var max = handler.parentElement.clientHeight - handler.clientHeight;\n var yPosInit = 0;\n handler.addEventListener('mousedown', function (event) {\n nonNativeScroll = true;\n yPosInit = event.clientY - Number(handler.style.top.replace('px', ''));\n document.addEventListener('mousemove', drag);\n document.addEventListener('mouseup', stop);\n });\n content.addEventListener('scroll', function (event) {\n if (!_this.nonNativeScroll) {\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n handler.style.top = content.scrollTop / coefficient + 'px';\n }\n });\n function drag() {\n // console.log(event.clientY - yPosInit, Number(handler.style.top.replace('px','' )))\n var pos = event.clientY - yPosInit;\n var clampPos = Math.min(Math.max(pos, 0), max);\n handler.style.top = clampPos + \"px\";\n var handlerPathLength = handler.parentElement.clientHeight - handler.clientHeight; //TODO recalculate only on resize event\n var coefficient = (content.scrollHeight - content.clientHeight) / handlerPathLength;\n // console.log(clampPos, coefficient, content.clientHeight, clampPos* coefficient)\n\n content.scrollTop = clampPos * coefficient;\n }\n function stop() {\n // console.log(\"stop\")\n document.removeEventListener('mousemove', drag);\n document.removeEventListener('mouseup', stop);\n nonNativeScroll = false;\n }\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/scrollbar/scrollbar.js?"); - -/***/ }), - -/***/ "./src/wde/wde-desktop.js": -/*!********************************!*\ - !*** ./src/wde/wde-desktop.js ***! - \********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebDesktopEnvironment)\n/* harmony export */ });\n/* harmony import */ var _decorat_desktop_decorat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../decorat/desktop-decorat */ \"./src/decorat/desktop-decorat.js\");\n/* harmony import */ var _scrollbar_scrollbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scrollbar/scrollbar */ \"./src/wde/scrollbar/scrollbar.js\");\n/* harmony import */ var _web_fs_web_fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../web-fs/web-fs */ \"./src/web-fs/web-fs.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\n\n\n// import DesktopSunBoard from \"./sunboard/sunboard-desktop\";\nvar _decorat = /*#__PURE__*/new WeakMap();\nvar _devLoadSunboard = /*#__PURE__*/new WeakSet();\nvar WebDesktopEnvironment = /*#__PURE__*/function () {\n /**@type {DesktopDecorat} */\n\n // static decorat\n\n function WebDesktopEnvironment() {\n _classCallCheck(this, WebDesktopEnvironment);\n _classPrivateMethodInitSpec(this, _devLoadSunboard);\n _classPrivateFieldInitSpec(this, _decorat, {\n writable: true,\n value: void 0\n });\n document.body.style.setProperty('--zoom', 1);\n _classPrivateFieldSet(this, _decorat, new _decorat_desktop_decorat__WEBPACK_IMPORTED_MODULE_0__[\"default\"]());\n WebDesktopEnvironment.webFs = new _web_fs_web_fs__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n // this.loadWDE()\n _classPrivateMethodGet(this, _devLoadSunboard, _devLoadSunboard2).call(this);\n }\n _createClass(WebDesktopEnvironment, [{\n key: \"loadWDE\",\n value: function () {\n var _loadWDE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var autoStart, _iterator, _step, child, appPath, args, argsRaw, _iterator2, _step2, argRaw, arg;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n autoStart = document.body.querySelector(\"wde-autostart\");\n if (!(autoStart == null)) {\n _context.next = 4;\n break;\n }\n WebDesktopEnvironment.Alert(\"Error in loading DE\");\n return _context.abrupt(\"return\");\n case 4:\n _iterator = _createForOfIteratorHelper(autoStart.children);\n _context.prev = 5;\n _iterator.s();\n case 7:\n if ((_step = _iterator.n()).done) {\n _context.next = 41;\n break;\n }\n child = _step.value;\n if (!(child.nodeName != \"APP\")) {\n _context.next = 11;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 11:\n appPath = child.getAttribute(\"app-path\");\n if (!(appPath == null)) {\n _context.next = 14;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 14:\n args = [];\n argsRaw = child.querySelector(\"args\");\n if (!(argsRaw == null)) {\n _context.next = 18;\n break;\n }\n return _context.abrupt(\"continue\", 39);\n case 18:\n _iterator2 = _createForOfIteratorHelper(argsRaw.children);\n _context.prev = 19;\n _iterator2.s();\n case 21:\n if ((_step2 = _iterator2.n()).done) {\n _context.next = 29;\n break;\n }\n argRaw = _step2.value;\n arg = argRaw.getAttribute(\"string\");\n if (!(arg == null)) {\n _context.next = 26;\n break;\n }\n return _context.abrupt(\"continue\", 27);\n case 26:\n args.push(arg);\n case 27:\n _context.next = 21;\n break;\n case 29:\n _context.next = 34;\n break;\n case 31:\n _context.prev = 31;\n _context.t0 = _context[\"catch\"](19);\n _iterator2.e(_context.t0);\n case 34:\n _context.prev = 34;\n _iterator2.f();\n return _context.finish(34);\n case 37:\n _context.next = 39;\n return WebDesktopEnvironment.Open(appPath, args);\n case 39:\n _context.next = 7;\n break;\n case 41:\n _context.next = 46;\n break;\n case 43:\n _context.prev = 43;\n _context.t1 = _context[\"catch\"](5);\n _iterator.e(_context.t1);\n case 46:\n _context.prev = 46;\n _iterator.f();\n return _context.finish(46);\n case 49:\n autoStart.remove();\n case 50:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[5, 43, 46, 49], [19, 31, 34, 37]]);\n }));\n function loadWDE() {\n return _loadWDE.apply(this, arguments);\n }\n return loadWDE;\n }()\n /**\r\n * @param {string} appPath\r\n * @param {string[]} args\r\n * @param {string} runPath\r\n */\n }], [{\n key: \"Open\",\n value: function () {\n var _Open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(appPath, args, runPath) {\n var appManifest, runContext;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return WebDesktopEnvironment.fetchApp(appPath);\n case 2:\n appManifest = _context2.sent;\n if (!(appManifest === undefined)) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n //TODO return err\n runContext = {\n isMobile: false,\n bundlePath: appPath,\n runPath: runPath //TODO\n };\n\n if (WebDesktopEnvironment.Applications[appManifest.appId] === undefined) {\n WebDesktopEnvironment.load2(appManifest, function () {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n });\n } else {\n WebDesktopEnvironment.Applications[appManifest.appId].NewWindow(args, runContext);\n }\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n function Open(_x, _x2, _x3) {\n return _Open.apply(this, arguments);\n }\n return Open;\n }()\n /**\r\n * @param {string} appManifest\r\n * @param {function} onload callback after script loading\r\n */\n }, {\n key: \"load2\",\n value: function () {\n var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(appManifest, onload) {\n var appElem, script;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n appElem = document.createElement(\"div\");\n appElem.setAttribute(\"appId\", appManifest.appId);\n //TODO Render scripts nodes on server\n //FIXME Not support more than one js now :)\n script = document.createElement(\"script\");\n script.setAttribute(\"src\", appManifest.js[0]); //FIXME path by fs read\n script.setAttribute(\"async\", \"false\"); //TODO Possible may creates a problems??\n appElem.appendChild(script);\n document.getElementById(\"applications\").appendChild(appElem);\n script.addEventListener('load', function (event) {\n var newApp = eval(\"new \".concat(appManifest.appId, \"()\"));\n //TODO Check if newApp undefined\n WebDesktopEnvironment.Applications[appManifest.appId] = newApp;\n onload();\n });\n return _context3.abrupt(\"return\");\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function load2(_x4, _x5) {\n return _load.apply(this, arguments);\n }\n return load2;\n }()\n /**\r\n * @param {string} path\r\n * @returns {Object | undefined} //FIXME\r\n */\n }, {\n key: \"fetchApp\",\n value: function () {\n var _fetchApp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(path) {\n var params, response, error, appManifest;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n // console.log(\"path: \" + path )\n params = new URLSearchParams({\n path: path,\n mode: \"json\"\n });\n _context4.next = 3;\n return fetch(\"/system/loadApp?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 10;\n break;\n }\n _context4.next = 7;\n return response.json();\n case 7:\n error = _context4.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context4.abrupt(\"return\", undefined);\n case 10:\n //TODO Validate manifest\n appManifest = response.json();\n return _context4.abrupt(\"return\", appManifest);\n case 12:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function fetchApp(_x6) {\n return _fetchApp.apply(this, arguments);\n }\n return fetchApp;\n }()\n /**\r\n * @param {string} appId\r\n * @param {number} width\r\n * @param {number} height\r\n * @returns {HTMLElement}\r\n */\n }, {\n key: \"CreateNewWindow\",\n value: function CreateNewWindow(appId, width, height) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute('appid', appId);\n if (WebDesktopEnvironment.isMobile) {\n newWindow.setAttribute(\"class\", \"MobileApplicationWindow\");\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n return newWindow;\n } else {\n newWindow.setAttribute(\"class\", \"WindowFrame ConvexElement\");\n newWindow.setAttribute(\"windowId\", WebDesktopEnvironment.makeid(4)); //TODO:\n\n newWindow.style.width = width.toString() + \"px\";\n newWindow.style.height = height.toString() + \"px\";\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n return newWindow;\n }\n }\n /**\r\n * @param {HTMLElement} window\r\n */\n }, {\n key: \"CloseWindow\",\n value: function CloseWindow(window) {\n window.remove();\n }\n }, {\n key: \"CloseFocusedWindow\",\n value: function CloseFocusedWindow() {\n if (document.body.querySelector('#windows-layer').childElementCount > 1) {\n document.body.querySelector('#windows-layer').lastElementChild.remove();\n }\n }\n\n /**\r\n * @param {string} html\r\n */\n }, {\n key: \"SetBasicWindow\",\n value: function SetBasicWindow(html) {\n this.basicWindow = html;\n }\n\n /**\r\n * @returns {string}\r\n */\n }, {\n key: \"GetBasicWindow\",\n value: function GetBasicWindow() {\n return this.basicWindow;\n }\n\n /**\r\n * @param {string} alertText\r\n */\n }, {\n key: \"Alert\",\n value: function Alert(alertText) {\n WebDesktopEnvironment.CreateAlertWindow(alertText);\n console.log(alertText);\n }\n\n /**\r\n * @param {string} alertText\r\n */\n }, {\n key: \"CreateAlertWindow\",\n value: function CreateAlertWindow(alertText) {\n var newWindow = document.createElement(\"div\");\n newWindow.setAttribute(\"class\", \"WindowFrameless\");\n newWindow.setAttribute(\"windowId\", \"SuperUniqUUID\"); //TODO:\n newWindow.style.cssText = \"position:absolute;width:450px;height:116px; margin-left: -225px; margin-top:-58px;left: 50%;top: 50%;background-color:#FFFFFF;border: 1px solid #000000;box-shadow: 2px 2px 0px #000000;\";\n var alertImage = document.createElement(\"img\");\n alertImage.setAttribute(\"src\", \"/res/sys/wde/icons/ohno.png\");\n alertImage.style.cssText = \"position:absolute; width:64px;height:64px;top:15px;left:25px\";\n newWindow.appendChild(alertImage);\n var errorText = document.createElement(\"div\");\n errorText.style.cssText = \"position:absolute; width: 300px; left:128px; top:30px;font-family: 'Virtue';\";\n errorText.innerHTML = alertText;\n newWindow.appendChild(errorText);\n var closeButton = document.createElement(\"button\");\n closeButton.style.cssText = \"position:absolute; left: 382px; bottom: 10px; background-color:#FFFFFF; width: 55px; height:18px; font-family: 'Virtue'; border-radius:4px;border: 1px solid #000000;\";\n closeButton.innerHTML = \"Close\";\n closeButton.addEventListener('click', function () {\n newWindow.remove();\n });\n newWindow.appendChild(closeButton);\n document.body.querySelector('#windows-layer').appendChild(newWindow);\n }\n\n /**\r\n * @param {num} length\r\n */\n }, {\n key: \"makeid\",\n value: function makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n var counter = 0;\n while (counter < length) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n }\n }]);\n return WebDesktopEnvironment;\n}();\nfunction _devLoadSunboard2() {\n return _devLoadSunboard3.apply(this, arguments);\n}\nfunction _devLoadSunboard3() {\n _devLoadSunboard3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n return _devLoadSunboard3.apply(this, arguments);\n}\n_defineProperty(WebDesktopEnvironment, \"Applications\", {});\n_defineProperty(WebDesktopEnvironment, \"isMobile\", false);\n_defineProperty(WebDesktopEnvironment, \"webFs\", void 0);\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/wde-desktop.js?"); - -/***/ }), - -/***/ "./src/web-fs/web-fs.js": -/*!******************************!*\ - !*** ./src/web-fs/web-fs.js ***! - \******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WebFS)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nvar WebFS = /*#__PURE__*/function () {\n function WebFS() {\n _classCallCheck(this, WebFS);\n }\n _createClass(WebFS, null, [{\n key: \"CreateDirectory\",\n value:\n /**\r\n * @param {string} path\r\n * @returns {boolean}\r\n */\n function () {\n var _CreateDirectory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(path == undefined)) {\n _context.next = 3;\n break;\n }\n WebDesktopEnvironment.Alert(\"Path is undefined\");\n return _context.abrupt(\"return\", false);\n case 3:\n params = new URLSearchParams({\n path: \"\".concat(path, \"/New Directory\")\n });\n _context.next = 6;\n return fetch(\"/system/fs/createDir?\" + params);\n case 6:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 10;\n break;\n }\n WebDesktopEnvironment.Alert(\"DIRCTORY CREATION ERROR\"); //TODO\n return _context.abrupt(\"return\", false);\n case 10:\n return _context.abrupt(\"return\", true);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n function CreateDirectory(_x) {\n return _CreateDirectory.apply(this, arguments);\n }\n return CreateDirectory;\n }()\n /**\r\n * @param {string} path\r\n * @returns {boolean}\r\n */\n }, {\n key: \"DeleteFile\",\n value: function () {\n var _DeleteFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n params = new URLSearchParams({\n path: path\n });\n _context2.next = 3;\n return fetch(\"/system/fs/delete?\" + params);\n case 3:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"DELETE ERROR\"); //TODO\n return _context2.abrupt(\"return\", false);\n case 7:\n return _context2.abrupt(\"return\", true);\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n function DeleteFile(_x2) {\n return _DeleteFile.apply(this, arguments);\n }\n return DeleteFile;\n }()\n /**\r\n * @param {string} path\r\n * @returns {boolean}\r\n */\n }, {\n key: \"MoveFile\",\n value: function () {\n var _MoveFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sourcePath, targetPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n targetPath: targetPath\n });\n _context3.next = 3;\n return fetch(\"/system/fs/move?\" + params);\n case 3:\n response = _context3.sent;\n if (!(response.status != 200)) {\n _context3.next = 6;\n break;\n }\n return _context3.abrupt(\"return\", false);\n case 6:\n return _context3.abrupt(\"return\", true);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function MoveFile(_x3, _x4) {\n return _MoveFile.apply(this, arguments);\n }\n return MoveFile;\n }()\n /**\r\n * @param {string} linkPath\r\n * @returns {string}\r\n */\n }, {\n key: \"ReadObjectLink\",\n value: function () {\n var _ReadObjectLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(linkPath) {\n var params, response, path;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context4.next = 3;\n return fetch(\"/system/fs/readObjectLink?\" + params);\n case 3:\n response = _context4.sent;\n if (!(response.status != 200)) {\n _context4.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context4.abrupt(\"return\", \"\");\n case 7:\n _context4.next = 9;\n return response.text();\n case 9:\n path = _context4.sent;\n return _context4.abrupt(\"return\", path);\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n function ReadObjectLink(_x5) {\n return _ReadObjectLink.apply(this, arguments);\n }\n return ReadObjectLink;\n }()\n /**\r\n * @param {string} sourcePath\r\n * @param {string} linkPath\r\n * @returns {string}\r\n */\n }, {\n key: \"CreatePathLink\",\n value: function () {\n var _CreatePathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(sourcePath, linkPath) {\n var params, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n params = new URLSearchParams({\n sourcePath: sourcePath,\n linkPath: linkPath\n });\n _context5.next = 3;\n return fetch(\"/system/fs/createPathLink?\" + params);\n case 3:\n response = _context5.sent;\n return _context5.abrupt(\"return\", response.status == 200);\n case 5:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n function CreatePathLink(_x6, _x7) {\n return _CreatePathLink.apply(this, arguments);\n }\n return CreatePathLink;\n }()\n /**\r\n * @param {string} linkPath\r\n * @returns {string}\r\n */\n }, {\n key: \"ReadPathLink\",\n value: function () {\n var _ReadPathLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(linkPath) {\n var params, response, file;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n params = new URLSearchParams({\n linkPath: linkPath\n });\n _context6.next = 3;\n return fetch(\"/system/fs/readPathLink?\" + params);\n case 3:\n response = _context6.sent;\n if (!(response.status != 200)) {\n _context6.next = 7;\n break;\n }\n WebDesktopEnvironment.Alert(\"TODO\"); //TODO\n return _context6.abrupt(\"return\", \"\");\n case 7:\n _context6.next = 9;\n return response.json();\n case 9:\n file = _context6.sent;\n return _context6.abrupt(\"return\", file);\n case 11:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n function ReadPathLink(_x8) {\n return _ReadPathLink.apply(this, arguments);\n }\n return ReadPathLink;\n }()\n /**\r\n * @param {File} file\r\n * @param {string} parentPath\r\n * @returns {boolean}\r\n */\n }, {\n key: \"UploadFile\",\n value: function () {\n var _UploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file, parentPath) {\n var formData, params, response, error;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n console.log('here');\n formData = new FormData();\n formData.append(\"file\", file); //FIXME Conn reset\n params = new URLSearchParams({\n parentPath: parentPath\n });\n _context7.next = 6;\n return fetch(\"/system/fs/upload?\" + params, {\n method: \"POST\",\n //TODO Change to PUT?\n body: formData\n });\n case 6:\n response = _context7.sent;\n console.log(response.status);\n if (!(response.status != 201)) {\n _context7.next = 14;\n break;\n }\n _context7.next = 11;\n return response.json();\n case 11:\n error = _context7.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context7.abrupt(\"return\", false);\n case 14:\n return _context7.abrupt(\"return\", true);\n case 15:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7);\n }));\n function UploadFile(_x9, _x10) {\n return _UploadFile.apply(this, arguments);\n }\n return UploadFile;\n }()\n }]);\n return WebFS;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/web-fs/web-fs.js?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. -/******/ var __webpack_exports__ = __webpack_require__("./src/desktop.js"); -/******/ -/******/ })() -; \ No newline at end of file diff --git a/res/dev-fs/wde/dist/desktop.js.LICENSE.txt b/res/dev-fs/wde/dist/desktop.js.LICENSE.txt deleted file mode 100644 index ae386fb..0000000 --- a/res/dev-fs/wde/dist/desktop.js.LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ diff --git a/res/dev-fs/wde/dist/finder.js b/res/dev-fs/wde/dist/finder.js deleted file mode 100644 index 06ede21..0000000 --- a/res/dev-fs/wde/dist/finder.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/apps/finder/finder-window.js": -/*!******************************************!*\ - !*** ./src/apps/finder/finder-window.js ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ FinderWindow)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nvar FinderWindow = /*#__PURE__*/function () {\n function FinderWindow() {\n _classCallCheck(this, FinderWindow);\n _defineProperty(this, \"curPath\", \"\");\n _defineProperty(this, \"fileView\", undefined);\n _defineProperty(this, \"windowElem\", undefined);\n }\n _createClass(FinderWindow, [{\n key: \"Init\",\n value: function () {\n var _Init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(args, appContext) {\n var _this = this;\n var desktopNode, _params, _response, _html, params, response, error, html, newWindow, scrollBar;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(args[1] == \"--desktop\")) {\n _context.next = 20;\n break;\n }\n desktopNode = document.body.querySelector(\"#\".concat(args[2]));\n if (!(desktopNode == null)) {\n _context.next = 5;\n break;\n }\n WebDesktopEnvironment.Alert(\"Desktop node not found\");\n return _context.abrupt(\"return\");\n case 5:\n _params = new URLSearchParams({\n path: args[0]\n });\n _context.next = 8;\n return fetch(\"/app/\".concat(Finder.AppId, \"/renderDesktop?\") + _params, {\n method: \"POST\",\n body: JSON.stringify(appContext)\n });\n case 8:\n _response = _context.sent;\n if (!(_response.status != 200)) {\n _context.next = 13;\n break;\n }\n console.log(_response.status);\n WebDesktopEnvironment.Alert(\"Error in render desktop\"); //TODO\n return _context.abrupt(\"return\");\n case 13:\n _context.next = 15;\n return _response.text();\n case 15:\n _html = _context.sent;\n desktopNode.innerHTML = _html;\n this.fileView = new FileView(desktopNode.querySelector(\".FileTileView\"), function (event) {\n _this.Click(event);\n }, function (event) {\n _this.RightClick(event);\n }, function (event, draggedElem) {\n _this.DropEvent(event, draggedElem);\n }, function () {\n _this.ReRenderDir();\n });\n this.RenderDir(args[0]);\n return _context.abrupt(\"return\");\n case 20:\n params = new URLSearchParams({\n isMobile: WebDesktopEnvironment.isMobile\n });\n _context.next = 23;\n return fetch(\"/app/\".concat(Finder.AppId, \"/render?\") + params, {\n method: \"POST\",\n body: JSON.stringify(appContext)\n });\n case 23:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 30;\n break;\n }\n _context.next = 27;\n return response.json();\n case 27:\n error = _context.sent;\n WebDesktopEnvironment.Alert(error.message);\n return _context.abrupt(\"return\");\n case 30:\n _context.next = 32;\n return response.text();\n case 32:\n html = _context.sent;\n newWindow = WebDesktopEnvironment.CreateNewWindow(Finder.AppId, 500, 350);\n newWindow.innerHTML = html;\n this.fileView = new FileView(newWindow.querySelector(\".FileTileView\"), function (event) {\n _this.Click(event);\n }, function (event) {\n _this.RightClick(event);\n }, function (event, draggedElem) {\n _this.DropEvent(event, draggedElem);\n }, function () {\n _this.ReRenderDir();\n });\n newWindow.querySelector(\"#closeWindowButton\").addEventListener('click', function (params) {\n WebDesktopEnvironment.CloseWindow(newWindow);\n });\n newWindow.querySelector(\"#RootButton\").addEventListener('click', function () {\n _this.RenderDir('/');\n });\n newWindow.querySelector(\"#HomeButton\").addEventListener('click', function () {\n _this.RenderDir('/home/user');\n });\n scrollBar = new WdeScrollBar(newWindow.querySelector(\".ScrollbarPlace\"), newWindow.querySelector(\".FileTileView\"));\n this.windowElem = newWindow;\n this.RenderDir(args[0]);\n case 42:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function Init(_x, _x2) {\n return _Init.apply(this, arguments);\n }\n return Init;\n }()\n /**\r\n * @param {string} path\r\n */\n }, {\n key: \"RenderDir\",\n value: function RenderDir(path) {\n this.curPath = path;\n this.fileView.OpenFolder(path);\n }\n }, {\n key: \"ReRenderDir\",\n value: function ReRenderDir() {\n this.RenderDir(this.curPath);\n }\n\n /**\r\n * @param {DragEvent} event\r\n * @param {HTMLElement} draggedElem\r\n */\n }, {\n key: \"DropEvent\",\n value: function () {\n var _DropEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {\n var sourcePath, targetPath, res, files, i, file, _res, params, response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(event.dataTransfer.getData(\"dropType\") == \"move\")) {\n _context2.next = 9;\n break;\n }\n sourcePath = event.dataTransfer.getData(\"filePath\");\n targetPath = this.curPath + \"/\" + event.dataTransfer.getData(\"fileName\");\n _context2.next = 5;\n return WebFS.MoveFile(sourcePath, targetPath);\n case 5:\n res = _context2.sent;\n if (res) {\n this.ReRenderDir();\n } else {\n WebDesktopEnvironment.Alert(\"UWAGA TODO MOVE FILE ERROR\"); //TODO\n }\n _context2.next = 28;\n break;\n case 9:\n console.log(event, this.curPath);\n files = event.dataTransfer.files;\n i = 0;\n case 12:\n if (!(i < files.length)) {\n _context2.next = 22;\n break;\n }\n file = files[i];\n console.log(\"file:\" + file.name);\n _context2.next = 17;\n return WebFS.UploadFile(file, this.curPath);\n case 17:\n _res = _context2.sent;\n if (_res) {\n this.ReRenderDir();\n }\n case 19:\n i++;\n _context2.next = 12;\n break;\n case 22:\n return _context2.abrupt(\"return\");\n case 26:\n response = _context2.sent;\n if (response.status != 200) {\n WebDesktopEnvironment.Alert(\"ERROR IN UPLOADING FILE\"); //TODO\n } else {\n this.ReRenderDir();\n }\n case 28:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function DropEvent(_x3) {\n return _DropEvent.apply(this, arguments);\n }\n return DropEvent;\n }()\n /**\r\n * @param {MouseEvent} event\r\n */\n }, {\n key: \"Click\",\n value: function Click(event) {\n this.OpenFile(this.curPath, event.target.getAttribute(\"name\"), event.target.getAttribute(\"filetype\"));\n }\n\n /**\r\n * @param {string} filePath\r\n */\n }, {\n key: \"OpenFile\",\n value: function () {\n var _OpenFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parentPath, fileName, fileType) {\n var fileExtension, res;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n // console.log(parentPath, fileName, fileType)\n // const splittedPath = filePath.split(\"/\")\n // const fileName = splittedPath[splittedPath.length - 1]\n fileExtension = fileName.split(\".\")[fileName.split(\".\").length - 1]; //FIXME\n _context3.t0 = true;\n _context3.next = _context3.t0 === (fileType == \"objectlink\") ? 4 : _context3.t0 === (fileType == \"pathlink\") ? 6 : _context3.t0 === (fileExtension == \"app\") ? 12 : _context3.t0 === (fileExtension == \"blog\") ? 14 : _context3.t0 === (fileType == \"directory\") ? 16 : _context3.t0 === (fileExtension == \"blog\") ? 18 : _context3.t0 === (fileExtension == \"jpeg\" | fileExtension == \"png\") ? 20 : 22;\n break;\n case 4:\n WebDesktopEnvironment.Alert(\"Links not supported yet\");\n return _context3.abrupt(\"break\", 24);\n case 6:\n _context3.next = 8;\n return WebFS.ReadPathLink(\"\".concat(parentPath, \"/\").concat(fileName));\n case 8:\n res = _context3.sent;\n console.log(res);\n this.OpenFile(res.parentPath, res.name, res.filetype);\n return _context3.abrupt(\"break\", 24);\n case 12:\n WebDesktopEnvironment.Open(\"\".concat(parentPath, \"/\").concat(fileName), []);\n return _context3.abrupt(\"break\", 24);\n case 14:\n WebDesktopEnvironment.Open(\"/Applications/BlogViewer.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 16:\n WebDesktopEnvironment.Open(\"/Applications/Finder.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 18:\n WebDesktopEnvironment.Open(\"/Applications/BlogViewer.app\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 20:\n WebDesktopEnvironment.Open(\"img-viewer\", [\"\".concat(parentPath, \"/\").concat(fileName)]);\n return _context3.abrupt(\"break\", 24);\n case 22:\n WebDesktopEnvironment.Alert(\"Unsupported file type\");\n return _context3.abrupt(\"break\", 24);\n case 24:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n function OpenFile(_x4, _x5, _x6) {\n return _OpenFile.apply(this, arguments);\n }\n return OpenFile;\n }()\n /**\r\n * @param {MouseEvent} event\r\n */\n }, {\n key: \"RightClick\",\n value: function RightClick(event) {\n this.CreateContextMenu(event.target, [event.clientY, event.clientX]);\n }\n\n /**\r\n * @param {HTMLElement} target\r\n * @param {string[]} pos\r\n */\n }, {\n key: \"CreateContextMenu\",\n value: function () {\n var _CreateContextMenu = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(target, pos) {\n var _this2 = this;\n var context, fileName, fileType, path, params, response, html, overlay, menu;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n context = \"\";\n fileName = target.getAttribute(\"name\"); //TODO check for null\n fileType = target.getAttribute(\"fileType\");\n if (target.classList.contains(\"FileTileView\")) {\n context = \"FileTileView\";\n } else {\n context = fileType;\n }\n path = \"\";\n if (fileName === null) {\n path = this.curPath;\n } else {\n path = \"\".concat(this.curPath, \"/\").concat(fileName);\n }\n params = new URLSearchParams({\n context: context,\n path: path\n });\n _context5.next = 9;\n return fetch(\"/app/\".concat(Finder.AppId, \"/contextMenu?\") + params);\n case 9:\n response = _context5.sent;\n if (!(response.status != 200)) {\n _context5.next = 13;\n break;\n }\n WebDesktopEnvironment.Alert(\"ERROR in Context menu TODO\"); //TODO\n return _context5.abrupt(\"return\");\n case 13:\n _context5.next = 15;\n return response.text();\n case 15:\n html = _context5.sent;\n overlay = document.createElement(\"div\"); //TODO Move to WDE.CreateOverlay()\n overlay.setAttribute('id', 'finder-context-menu-overlay');\n overlay.style.position = 'absolute';\n overlay.style.width = \"100%\";\n overlay.style.height = \"100%\";\n menu = document.createElement(\"div\");\n menu.setAttribute('class', 'ContextMenu WindowFrameShadow');\n menu.style.position = 'absolute';\n menu.style.top = pos[0] + \"px\";\n menu.style.left = pos[1] + \"px\";\n menu.innerHTML = html;\n // menu.children[0].firstElementChild.remove()\n menu.children[0].lastElementChild.remove(); //FIXME Can't ommit rendering of horLine in end of menu on backend\n\n overlay.appendChild(menu);\n document.body.appendChild(overlay);\n overlay.addEventListener('click', /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(event) {\n var res;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!event.target.classList.contains(\"Row\")) {\n _context4.next = 27;\n break;\n }\n //TODO add uuid id to rows to more accurate checks??\n res = false;\n _context4.t0 = event.target.children[0].getAttribute(\"action\");\n _context4.next = _context4.t0 === \"createPathLink\" ? 5 : _context4.t0 === \"createDir\" ? 10 : _context4.t0 === \"deleteFile\" ? 16 : _context4.t0 === \"getInfo\" ? 22 : _context4.t0 === \"openAsDir\" ? 24 : 26;\n break;\n case 5:\n _context4.next = 7;\n return WebFS.CreatePathLink(\"\".concat(_this2.curPath, \"/\").concat(fileName), \"\".concat(_this2.curPath, \"/Link to \").concat(fileName));\n case 7:\n res = _context4.sent;\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 10:\n _context4.next = 12;\n return WebFS.CreateDirectory(\"\".concat(_this2.curPath));\n case 12:\n res = _context4.sent;\n console.log(res);\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 16:\n _context4.next = 18;\n return WebFS.DeleteFile(\"\".concat(_this2.curPath, \"/\").concat(fileName));\n case 18:\n res = _context4.sent;\n console.log(res);\n if (res) {\n _this2.ReRenderDir();\n }\n return _context4.abrupt(\"break\", 27);\n case 22:\n Finder.RenderProperites(path);\n return _context4.abrupt(\"break\", 27);\n case 24:\n WebDesktopEnvironment.Open(\"/Applications/\".concat(Finder.AppId, \".app\"), [\"\".concat(_this2.curPath, \"/\").concat(fileName)]);\n return _context4.abrupt(\"break\", 27);\n case 26:\n return _context4.abrupt(\"break\", 27);\n case 27:\n overlay.remove();\n case 28:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n return function (_x9) {\n return _ref.apply(this, arguments);\n };\n }());\n overlay.addEventListener('contextmenu', function (event) {\n event.preventDefault();\n overlay.remove();\n });\n case 32:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n function CreateContextMenu(_x7, _x8) {\n return _CreateContextMenu.apply(this, arguments);\n }\n return CreateContextMenu;\n }()\n }]);\n return FinderWindow;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder-window.js?"); - -/***/ }), - -/***/ "./src/apps/finder/finder.js": -/*!***********************************!*\ - !*** ./src/apps/finder/finder.js ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _finder_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./finder-window */ \"./src/apps/finder/finder-window.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n__webpack_require__(/*! ./finder.less */ \"./src/apps/finder/finder.less\");\n\nvar Finder = /*#__PURE__*/function () {\n function Finder() {\n _classCallCheck(this, Finder);\n }\n _createClass(Finder, [{\n key: \"NewWindow\",\n value:\n /**\r\n * @param {string[]} args\r\n */\n function () {\n var _NewWindow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(args, runContext) {\n var newFinder;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n newFinder = new _finder_window__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _context.next = 3;\n return newFinder.Init(args, runContext);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n function NewWindow(_x, _x2) {\n return _NewWindow.apply(this, arguments);\n }\n return NewWindow;\n }()\n /**\r\n * @param {string} path\r\n * @returns {boolean}\r\n */\n }], [{\n key: \"RenderProperites\",\n value: function () {\n var _RenderProperites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {\n var params, response, html, newWindow;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(path == null || path == \"\")) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n params = new URLSearchParams({\n path: path\n });\n _context2.next = 5;\n return fetch(\"/app/\".concat(Finder.AppId, \"/renderProps?\") + params);\n case 5:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 9;\n break;\n }\n WebDesktopEnvironment.Alert(\"Error in properties render\"); //TODO\n return _context2.abrupt(\"return\", false);\n case 9:\n _context2.next = 11;\n return response.text();\n case 11:\n html = _context2.sent;\n newWindow = WebDesktopEnvironment.CreateNewWindow(Finder.AppId, 350, 500);\n newWindow.innerHTML = html;\n newWindow.querySelector(\"#closeWindowButton\").addEventListener('click', function (params) {\n WebDesktopEnvironment.CloseWindow(newWindow);\n });\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n function RenderProperites(_x3) {\n return _RenderProperites.apply(this, arguments);\n }\n return RenderProperites;\n }()\n }]);\n return Finder;\n}();\n_defineProperty(Finder, \"AppId\", \"Finder\");\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder.js?"); - -/***/ }), - -/***/ "./src/apps/finder/finder.less": -/*!*************************************!*\ - !*** ./src/apps/finder/finder.less ***! - \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://my-webpack-project/./src/apps/finder/finder.less?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. -/******/ var __webpack_exports__ = __webpack_require__("./src/apps/finder/finder.js"); -/******/ -/******/ })() -; \ No newline at end of file diff --git a/res/dev-fs/wde/dist/init.js b/res/dev-fs/wde/dist/init.js deleted file mode 100644 index 6870af5..0000000 --- a/res/dev-fs/wde/dist/init.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./src/init.js": -/*!*********************!*\ - !*** ./src/init.js ***! - \*********************/ -/***/ (() => { - -eval("document.addEventListener('DOMContentLoaded', function () {\n console.log(\"init\");\n}, false);\n\n//# sourceURL=webpack://my-webpack-project/./src/init.js?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. -/******/ var __webpack_exports__ = {}; -/******/ __webpack_modules__["./src/init.js"](); -/******/ -/******/ })() -; \ No newline at end of file diff --git a/res/dev-fs/wde/dist/mobile.css b/res/dev-fs/wde/dist/mobile.css deleted file mode 100644 index 1bc992f..0000000 --- a/res/dev-fs/wde/dist/mobile.css +++ /dev/null @@ -1,49 +0,0 @@ -/*!**********************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/mobile.less ***! - \**********************************************************************************************************/ -.WdePrimitives.AdjectiveElement, -#down-bar { - border: 1px solid #555555; -} -#mobile-sunboard { - width: 100%; - height: 100%; - /* Auto layout */ - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: flex-start; -} -#icons { - width: 100%; - height: 100%; - background-color: #9999CC; -} -#down-bar { - width: 100%; - height: 150px; - background-color: #C0C0C0; -} -body { - zoom: var(--zoom); - position: absolute; - width: 100%; - height: 100%; - margin: 0px; - /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - -khtml-user-select: none; - /* Konqueror HTML */ - -moz-user-select: none; - /* Old versions of Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /* Non-prefixed version, currently - supported by Chrome, Edge, Opera and Firefox */ - touch-action: manipulation; -} - diff --git a/res/dev-fs/wde/dist/mobile.js b/res/dev-fs/wde/dist/mobile.js deleted file mode 100644 index b36939d..0000000 --- a/res/dev-fs/wde/dist/mobile.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/Decorat/mobile-decorat.js": -/*!***************************************!*\ - !*** ./src/Decorat/mobile-decorat.js ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MobileDecorat)\n/* harmony export */ });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar MobileDecorat = /*#__PURE__*/_createClass(function MobileDecorat() {\n _classCallCheck(this, MobileDecorat);\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/Decorat/mobile-decorat.js?"); - -/***/ }), - -/***/ "./src/mobile.js": -/*!***********************!*\ - !*** ./src/mobile.js ***! - \***********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wde_wde_mobile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wde/wde-mobile */ \"./src/wde/wde-mobile.js\");\n\n__webpack_require__(/*! ./mobile.less */ \"./src/mobile.less\");\ndocument.addEventListener('DOMContentLoaded', function () {\n var wde = new _wde_wde_mobile__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n}, false);\n\n//# sourceURL=webpack://my-webpack-project/./src/mobile.js?"); - -/***/ }), - -/***/ "./src/wde/wde-mobile.js": -/*!*******************************!*\ - !*** ./src/wde/wde-mobile.js ***! - \*******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MobileWebDesktopEnvironment)\n/* harmony export */ });\n/* harmony import */ var _Decorat_mobile_decorat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Decorat/mobile-decorat */ \"./src/Decorat/mobile-decorat.js\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar _decorat = /*#__PURE__*/new WeakMap();\nvar MobileWebDesktopEnvironment = /*#__PURE__*/_createClass( /** @type {MobileDecorat} */\n\nfunction MobileWebDesktopEnvironment() {\n _classCallCheck(this, MobileWebDesktopEnvironment);\n _classPrivateFieldInitSpec(this, _decorat, {\n writable: true,\n value: void 0\n });\n document.body.style.setProperty('--zoom', 3);\n _classPrivateFieldSet(this, _decorat, new _Decorat_mobile_decorat__WEBPACK_IMPORTED_MODULE_0__[\"default\"]());\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/wde-mobile.js?"); - -/***/ }), - -/***/ "./src/mobile.less": -/*!*************************!*\ - !*** ./src/mobile.less ***! - \*************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://my-webpack-project/./src/mobile.less?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. -/******/ var __webpack_exports__ = __webpack_require__("./src/mobile.js"); -/******/ -/******/ })() -; \ No newline at end of file diff --git a/routes/private.go b/routes/private.go index 5176d7c..9ccb1a7 100644 --- a/routes/private.go +++ b/routes/private.go @@ -43,25 +43,24 @@ func PrivateRoutes(port string, webfs *webfilesystem.WebFileSystem, webde *wde.W AppPath: "/Applications/BlogViewer.app", Args: []string{"/home/user/Blogs/blog1.blog"}, } - + _ = appString aboutMe := AppString{ AppPath: "/Applications/AboutMe.app", Args: []string{}, } - + _ = aboutMe desktop := AppString{ AppPath: "/Applications/Finder.app", - Args: []string{"/home/user/.Desktop", "--desktop", "desktop-layer"}, + Args: []string{"/", "--desktop", "desktop-layer"}, } - autostart := []AppString{desktop, appString, aboutMe} + autostart := []AppString{desktop} d := mobile.GetDevice(ctx) - _ = autostart switch { // Hey I'm a desktop!... or laptop but not a mobile or tablet! case d.Normal(): ctx.HTML(http.StatusOK, "index.html", gin.H{ - // "autostart": autostart, + "autostart": autostart, }) // Hey I'm a mobile device! case d.Mobile(): diff --git a/templates/base/index.html b/templates/base/index.html index 6049172..faae0b9 100644 --- a/templates/base/index.html +++ b/templates/base/index.html @@ -20,9 +20,16 @@ --> - + + + + {{ range $app := .autostart }}