jgraph / drawio-desktop

Official electron build of draw.io
https://www.diagrams.net
Apache License 2.0
50.66k stars 5.02k forks source link

Support loading local libs from local path #1278

Open josephgarnier opened 1 year ago

josephgarnier commented 1 year ago

Preflight Checklist

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug Goal: In desktop version, use a custom library stored in local. I followed this FAQ article.

To Reproduce Steps to reproduce the behavior:

  1. Go in Extras->Configuration menu
  2. Paste this following json by replacing the url with a path to your local library (for example, one of them). Mine is C:\Users\garnj\AppData\Roaming\draw.io\shape_libraries\windows-10-icons.xml
{
  "debug": true,
  "defaultLibraries": "general;basic;arrows2;flowchart",
  "enabledLibraries": null,
  "libraries": [{
      "title": {
        "main": "Additional Libaries"
      },
      "entries": [ {
          "id": "windows-10-icons",
          "title": {
            "main": "Windows 10 Icons"
          },
          "desc": {
            "main": "Collection of Windows 10 Icons"
          },
          "libs": [{
              "title": {
                "main": "Windows 10 Icons Lib"
              },
              "url": "C%3A%5CUsers%5Cgarnj%5CAppData%5CRoaming%5Cdraw.io%5Cshape_libraries%5Cwindows-10-icons.xml",
              "prefetch": true
            }
          ]
        }
      ]
    }
  ],
  "enableCustomLibraries": true
}

Expected behavior The following error message is displayed :

image

I know there is a protection for remote urls (see here and here), but if this configuration does not work for local files, in what case to use it?

draw.io version (In the Help->About menu of the draw.io editor):

Desktop (please complete the following information):

davidjgraph commented 5 months ago

Changing this to a feature request. Only URLs are currently supported, that path isn't a URL. File protocol is not supported.